LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-19-2018, 11:26 PM   #1
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Rep: Reputation: 12
mdadm OK but no access to an array


I have successfully implemented RAID5.
Now in Gparted I see /dev/md127p1 thru /dev/md127p4.
I cannot copy or move anything into these partitions.

Am I missing some permission(s)?

Running Ubuntu 16.04

Code:
jim@jim-desktop:~$ sudo mdadm -D /dev/md127
/dev/md127:
        Version : 1.2
  Creation Time : Fri Oct 19 06:46:34 2018
     Raid Level : raid5
     Array Size : 204668928 (195.19 GiB 209.58 GB)
  Used Dev Size : 102334464 (97.59 GiB 104.79 GB)
   Raid Devices : 3
  Total Devices : 3
    Persistence : Superblock is persistent

    Update Time : Fri Oct 19 18:07:38 2018
          State : clean 
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 512K

           Name : jim-desktop:0  (local to host jim-desktop)
           UUID : 5afe531e:3c41ecd9:7057ae6e:98985049
         Events : 24

    Number   Major   Minor   RaidDevice State
       0       8        3        0      active sync   /dev/sda3
       1       8       36        1      active sync   /dev/sdc4
       3     259        2        2      active sync   /dev/sdd18
 
Old 10-19-2018, 11:41 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by AnneRanch View Post
I have successfully implemented RAID5.
Now in Gparted I see /dev/md127p1 thru /dev/md127p4.
I cannot copy or move anything into these partitions.
How did you create the partitions? What do you do to copy or move something into them? How do you know it doesn’t work?
 
Old 10-20-2018, 12:06 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Patience padawan - if you did in fact create things correctly, wait until the synch finishes.
 
Old 10-20-2018, 11:39 AM   #4
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by berndbausch View Post
How did you create the partitions?

Using mdadm verifying them via Gparted - as I already posted .

What do you do to copy or move something into them?

Using stysdadr "file save as " into partition.

How do you know it doesn’t work?
LibreOffice writer posts error "...file does not exists" Save file can be save anywhere else .

Moving file on desktop using mouse I get this error

Error opening file '/media/jim/DOC/VNA_2_BAD.txt': Permission denied
 
Old 10-20-2018, 11:44 AM   #5
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by syg00 View Post
Patience padawan - if you did in fact create things correctly, wait until the synch finishes.
If Gparted and my check shows OK, what did I do "incorrectly"?

Waiting for what ? The array has been build.
I was just checking / showing state.
I do not get what that got to do with using the array?
 
Old 10-20-2018, 06:04 PM   #6
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by AnneRanch View Post
LibreOffice writer posts error "...file does not exists" Save file can be save anywhere else .
This can be because one of the directories in the file path doesn’t exist.
Quote:
Moving file on desktop using mouse I get this error

Error opening file '/media/jim/DOC/VNA_2_BAD.txt': Permission denied
This is because the user that performs the move doesn’t have write permissions to DOC or to VNA_2_BAD.txt.

I don’t know what you mean by stysdadr.

Could you post the following:
  • output of lsblk
  • long listing of /, /media, /media/jim and /media/jim/DOC
  • as which user you are logged on
Also check the file to which you want to save your LibreOffice document. Does the file exist? Do all directories in the file’s path exist?

Last edited by berndbausch; 10-20-2018 at 06:06 PM.
 
Old 10-20-2018, 07:33 PM   #7
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
This is because the user that performs the move doesn’t have write permissions to DOC or to VNA_2_BAD.txt.

Allow me to reply.
I can save the file anywhere else.

HOW DO I CHANGE THE OWNERSHIP OF THE ARRAY?

I did try

chown jim /dev/md127
chown jim /dev/md0

I suppose I need to say it did not work

Last edited by AnneRanch; 10-20-2018 at 07:37 PM.
 
Old 10-20-2018, 07:52 PM   #8
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by AnneRanch View Post
This is because the user that performs the move doesn’t have write permissions to DOC or to VNA_2_BAD.txt.

Allow me to reply.
I can save the file anywhere else.

HOW DO I CHANGE THE OWNERSHIP OF THE ARRAY?

I did try

chown jim /dev/md127
chown jim /dev/md0

I suppose I need to say it did not work
You ned to distinguish between the device that contains the data and the filesystem structures that manage the data on the device. It’s the latter that control how you can read/write/delete/create files.

Car analogy: If you have the tools and access to the digital infrastructure in your car, which would allow you to repair its engine, you still need a key to drive it. Actually, the driver doesn’t need access to the engine and normally doesn’t have access; the key is sufficient. In your case, user jim is the driver. User root is the repair technician.

So, don’t modify the engine to drive the car, and don’t change device permissions to access files. Actually, this could break something. Instead, change the permissions of the files and directories on that device: media, jim, DOC and do on.

For example:
Code:
chown -R  jim:jim /media/jim

Last edited by berndbausch; 10-20-2018 at 07:54 PM.
 
Old 10-20-2018, 09:04 PM   #9
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Am I getting closer?

At this point I do not want to change ALL ownership, just the RAID array.


Quote:
jim@jim-desktop:/dev/md$ ls -l
total 0
lrwxrwxrwx 1 root root 8 Oct 20 19:10 jim-desktop:0 -> ../md127
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p1 -> ../md127p1
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p2 -> ../md127p2
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p3 -> ../md127p3
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p4 -> ../md127p4
jim@jim-desktop:/dev/md$ chown -R jim:jim /dev/md127
jim@jim-desktop:/dev/md$ ls -l
total 0
lrwxrwxrwx 1 root root 8 Oct 20 19:10 jim-desktop:0 -> ../md127
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p1 -> ../md127p1
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p2 -> ../md127p2
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p3 -> ../md127p3
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p4 -> ../md127p4
jim@jim-desktop:/dev/md$ chown -R jim:jim /dev/md0
jim@jim-desktop:/dev/md$ chown -R jim:jim /dev/md0
chown: cannot access '/dev/md0': No such file or directory
jim@jim-desktop:/dev/md$

root@jim-desktop:/home/jim# cd /dev/md
root@jim-desktop:/dev/md# ls -l
total 0
lrwxrwxrwx 1 root root 8 Oct 20 19:10 jim-desktop:0 -> ../md127
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p1 -> ../md127p1
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p2 -> ../md127p2
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p3 -> ../md127p3
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p4 -> ../md127p4
root@jim-desktop:/dev/md# chown jim:jim /dev/md127p1
root@jim-desktop:/dev/md# ls -l
total 0
lrwxrwxrwx 1 root root 8 Oct 20 19:10 jim-desktop:0 -> ../md127
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p1 -> ../md127p1
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p2 -> ../md127p2
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p3 -> ../md127p3
lrwxrwxrwx 1 root root 10 Oct 20 19:10 jim-desktop:0p4 -> ../md127p4
root@jim-desktop:/dev/md#

 
Old 10-20-2018, 10:39 PM   #10
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by AnneRanch View Post
Am I getting closer?
Not at all.

Quote:
At this point I do not want to change ALL ownership, just the RAID array.
You can do that, but it won't help with your problem of moving files and saving LibreOffice documents.

You need to change the ownership of the files and directories that are on the array. Not the ownership of the device. Presumably, the array is mounted at /media/jim. It is there that you have to adjust ownership or write permissions.

Changing device ownership has no effect on the file permissions. Like your car: If you have a way to open the hood, it doesn't mean you can open the door and drive it.
 
Old 10-21-2018, 07:24 AM   #11
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
OK, stupid question.
How can I change file ownership if I cannot save / copy /move the file there?

So which "disk" is the array?
RAID5 is 3 disk / four partitions.

Quote:
jim@jim-desktop:/media/jim$ ls -l
total 76
drwxrwxrwx 1 jim jim 4096 Nov 15 2016 0822C8912019FFC8
drwxrwxrwx 5 jim jim 4096 Jul 26 2017 Alternate downlo
drwxr-xr-x 3 jim jim 4096 Dec 31 1969 COPY_OS64_1
drwxr-xr-x 24 root root 4096 Oct 18 22:11 d6513968-3c2a-4e81-b223-7f7c11f1ae2e
drwxr-xr-x 33 jim root 4096 Oct 14 12:37 Eclipse
drwxrwxrwx 1 jim jim 8192 Apr 9 2016 Ex Drive Co
drwxr-xr-x 3 root root 4096 Aug 7 2017 OLD_DISK_2
drwxrwxrwx 1 jim jim 4096 Apr 9 2016 OpenCameraB
drwxrwxrwx 1 jim jim 8192 Aug 8 2017 OS-D
drwxrwxrwx 1 jim jim 8192 Dec 18 2017 Photo Album
drwxrwxrwx 1 jim jim 8192 Oct 17 22:32 Programs
drwxrwxrwx 1 jim jim 4096 Sep 14 2016 REsume
drwxr-xr-x 23 root root 4096 Aug 10 2017 SDR_5
drwxr-xr-x 3 root root 4096 Jul 16 2017 tets_PRIMARY
drwx------ 12 jim jim 4096 Oct 19 07:17 WorkspaceRaspber
jim@jim-desktop:/media/jim$

Last edited by AnneRanch; 10-21-2018 at 07:31 AM.
 
Old 10-21-2018, 08:47 AM   #12
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The array is storage device /dev/md127.

root can change ownership of files owned by root.

For example, under /media/jim you have four directories owned by root, and which have no write permissions for jim. If you try to create or overwrite a file in one of them, you generate an error. If you want these directories to have write permissions for jim, one possibility is changing ownership. Another is changing the permissions, i.e. setting the w flag. A third more advanced option is using file access control lists.
 
Old 10-21-2018, 09:20 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927
/dev/md127 is just the device ID. Once the array is built you still need to create a filesystem and mount it to the desired mount point.

Did you format and mount the array?

mkfs -t ext4 /dev/md127

mount -t ext4 /dev/md127 /mnt/my_array (Replace /mnt/my_array with your real mount point)
 
1 members found this post helpful.
Old 10-21-2018, 10:53 AM   #14
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by michaelk View Post
/dev/md127 is just the device ID. Once the array is built you still need to create a filesystem and mount it to the desired mount point.

Did you format and mount the array?

mkfs -t ext4 /dev/md127

mount -t ext4 /dev/md127 /mnt/my_array (Replace /mnt/my_array with your real mount point)
Formatted, but not mounted.

I got it working with all partitions mounted to common directory.
I am not getting partitions names so
I'll try to mount each individually next time.

Addendum
The mount point changed after changing ownership and reboot.
Still have some individual partitions issues due to different permissions. But in general it works.


Much appreciate all the help.

Last edited by AnneRanch; 10-21-2018 at 12:07 PM.
 
Old 10-21-2018, 12:59 PM   #15
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by AnneRanch View Post
Formatted, but not mounted.
If it’s not mounted, what do all your problems with /media/jim have to do with the array?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mdadm array troubles. Gangrif Linux - Software 2 09-04-2014 08:43 AM
[SOLVED] I can't fix my MDADM array jbruyet Linux - Software 2 01-10-2013 05:18 PM
[SOLVED] mdadm: only give one device per ARRAY line: /dev/md/:raid and array laughing_man77 Linux - Hardware 4 03-23-2012 04:05 PM
[SOLVED] Attempts to work around a mdadm bug/ mdadm cannot get exclusive access to /dev/md127 Sereph Linux - Newbie 1 08-16-2011 03:21 AM
ca't assembl mdadm array seaking1 Linux - Software 0 02-15-2009 04:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration