Page 1 of 1

[SOLVED] Permission for drive

PostPosted: Mar 11th, '12, 00:43
by RoyD
Hi, I am trying to setup a backup system so it backups up to another internal drive. I formatted it (ext4) and I gave it a mount point of /backup and a label of Backup. The permissions to the root directory is root, (can this be changed to user?). When I want to create a new top directory I can´t (itś grayed out). Also LuckyBackup can not create the top directory so it fails. What options do I have? or what am I doing wrong? Thanks for any help

Re: Permission for drive

PostPosted: Mar 11th, '12, 01:06
by doktor5000
Please show your /etc/fstab

Re: Permission for drive

PostPosted: Mar 11th, '12, 01:38
by RoyD
Hi this is my etc/fstab

Code: Select all
# Entry for /dev/sda1 :
UUID=fb88ff0f-7d89-4213-b23b-1b73a06ea64d / ext4 acl,relatime 1 1
# Entry for /dev/sda1 :
LABEL=backup /backup ext4 user 1 2
# Entry for /dev/sda6 :
UUID=7e491081-eaef-4963-97c5-5c57d6a7628a /home ext4 acl,relatime 1 2
/dev/cdrom /media/cdrom auto umask=0,users,iocharset=utf8,noauto,ro,exec 0 0
none /proc proc defaults 0 0
# Entry for /dev/sdb1 :
UUID=24e987b9-a1b1-4485-aef2-3048048ebbd8 /sdb ext4 defaults 1 2
# Entry for /dev/sdd1 :
UUID=86cebd0f-f126-4d48-9499-5afd46e01745 /vmm ext3 defaults 1 2

I decided to investigate ( that normal for me)
When I run ls -l /dev/disk/by-uuid/
I get
Code: Select all
[root@localhost ~]# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Mar 11 12:27 03d31702-f7cf-4fd5-aaca-7a5afc679f5e -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 11 12:27 24e987b9-a1b1-4485-aef2-3048048ebbd8 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 11 12:27 6ec7d301-e8f1-4c6d-b41b-88f609112f6e -> ../../sdc5
lrwxrwxrwx 1 root root 10 Mar 11 12:27 7e491081-eaef-4963-97c5-5c57d6a7628a -> ../../sdc6
lrwxrwxrwx 1 root root 10 Mar 11 12:27 86cebd0f-f126-4d48-9499-5afd46e01745 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Mar 11 12:27 fb88ff0f-7d89-4213-b23b-1b73a06ea64d -> ../../sdc1

I am no genius but are the UUID all messed up between the 2?

Re: Permission for drive

PostPosted: Mar 11th, '12, 15:30
by doktor5000
RoyD wrote:
[root@localhost ~]# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Mar 11 12:27 03d31702-f7cf-4fd5-aaca-7a5afc679f5e -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 11 12:27 24e987b9-a1b1-4485-aef2-3048048ebbd8 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 11 12:27 6ec7d301-e8f1-4c6d-b41b-88f609112f6e -> ../../sdc5
lrwxrwxrwx 1 root root 10 Mar 11 12:27 7e491081-eaef-4963-97c5-5c57d6a7628a -> ../../sdc6
lrwxrwxrwx 1 root root 10 Mar 11 12:27 86cebd0f-f126-4d48-9499-5afd46e01745 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Mar 11 12:27 fb88ff0f-7d89-4213-b23b-1b73a06ea64d -> ../../sdc1

I am no genius but are the UUID all messed up between the 2?

Uhmm, no, if you mean the ordering then that's the default result if you query for /dev/disk/by-uuid/
because it will be sorted by the UUIDs in ascending order, beginning with the "lowest" UUID
(just look at the first character of the UUIDs above)

For your fstab, there's no entry for /backup as you told above. Is /dev/sdb the drive you want to use
for that? It is currently mounted with the defaults, so only root can write there, this is normal behavior in that case.
Also, do you want that partition to be mounted at every boot?

Re: Permission for drive

PostPosted: Mar 11th, '12, 20:41
by RoyD
Its funny that under MCC it shows the following under Expert Mode
Code: Select all
Mount point: /backup
Device: sda1
Volume label: backup
UUID: 03d31702-f7cf-4fd5-aaca-7a5afc679f5e
Type: Journalised FS: ext4 (0x83)
Start: sector 63
Size: 465GB (99%), 976768002 sectors
Cylinder 0 to 60800
Mounted
Partition booted by default
    (for MS-DOS boot, not for lilo)

I guess I can disconnect my drive ad run these commands to see which one it is. Yes I do want that partition to be mounted at every boot? How do I change it so its not root?

Re: Permission for drive

PostPosted: Mar 11th, '12, 21:11
by doktor5000
Well, i'm confused, something is weird here.
Your fstab shows:
# Entry for /dev/sda1 :
UUID=fb88ff0f-7d89-4213-b23b-1b73a06ea64d / ext4 acl,relatime 1 1


ls -l /dev/disk/by-uuid/ shows
lrwxrwxrwx 1 root root 10 Mar 11 12:27 03d31702-f7cf-4fd5-aaca-7a5afc679f5e -> ../../sda1


MCC shows:

Mount point: /backup
Device: sda1
Volume label: backup
UUID: 03d31702-f7cf-4fd5-aaca-7a5afc679f5e


The problem is that sda1 is your root partition according to your fstab, but ls -l /dev/disk/by-uuid/ and MCC
show something different. Could you please show the output as root of blkid and mount?

Relating to changing the user or making it writeable for your user, there are many ways to do this.
You could allow your user to mount this, so you could mount it manually and it would belong to the user
who mounted it, or you could automatically mount it and specify a user who should be the owner of all
files, or you could make it writeable to everybody.
But first we need to clear up the confusion about your partitions.

Re: Permission for drive

PostPosted: Mar 11th, '12, 22:43
by Ken-Bergen
doktor5000 wrote:Well, i'm confused, something is weird here.
It's not weird and not unexpected behaviour when adding a hard drive.
When a drive is added the device nodes can change depending on which ports are used.
Mounting by UUID was introduced to overcome the problem of changing device nodes which it did here.
I find it strange that an internal drive would be mounted by LABEL rather than UUID but that shouldn't be a problem.
The problem as far as I can see is one of permissions on /backup and I think
Code: Select all
chmod 666 /backup
in a terminal as root should fix the problem.

Re: Permission for drive

PostPosted: Mar 12th, '12, 05:12
by RoyD
Here we go
Code: Select all
[root@localhost ~]# blkid
/dev/sda1: UUID="03d31702-f7cf-4fd5-aaca-7a5afc679f5e" TYPE="ext4" LABEL="backup"
/dev/sdc1: UUID="fb88ff0f-7d89-4213-b23b-1b73a06ea64d" TYPE="ext4"
/dev/sdc5: UUID="6ec7d301-e8f1-4c6d-b41b-88f609112f6e" TYPE="swap"
/dev/sdc6: UUID="7e491081-eaef-4963-97c5-5c57d6a7628a" TYPE="ext4"
/dev/sdb1: UUID="24e987b9-a1b1-4485-aef2-3048048ebbd8" TYPE="ext4"
/dev/sdd1: LABEL="Virtual Machines" UUID="86cebd0f-f126-4d48-9499-5afd46e01745" TYPE="ext3"


Code: Select all
[root@localhost ~]# mount
/dev/sdc1 on / type ext4 (rw,relatime,acl,commit=0)
none on /proc type proc (rw)
/dev/sda1 on /backup type ext4 (rw,noexec,nosuid,nodev,commit=0)
/dev/sdc6 on /home type ext4 (rw,relatime,acl,commit=0)
/dev/sdb1 on /sdb type ext4 (rw,commit=0)
/dev/sdd1 on /vmm type ext3 (rw,commit=0)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
gvfs-fuse-daemon on /home/roy/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=roy)
[root@localhost ~]#

Re: Permission for drive

PostPosted: Mar 12th, '12, 05:19
by RoyD
chmod 666 /backup in root did not fix the permission problem meaning a users can not create a directory. root can.

Re: Permission for drive

PostPosted: Mar 12th, '12, 05:26
by RoyD
I guess in the end I would like to automatically mount it and make it writeable to everybody.

Re: Permission for drive

PostPosted: Mar 12th, '12, 06:20
by Ken-Bergen
RoyD wrote:chmod 666 /backup in root did not fix the permission problem meaning a users can not create a directory. root can.
From the mount output it seems I was wrong and the LABEL entry in /etc/fstab is the problem.
Perhaps the doktor has a better idea but this is what I'd do.
Edit /etc/fstab, comment out the LABEL line and add a UUID line like this.
Code: Select all
# Entry for /dev/sda1 :
# LABEL=backup /backup ext4 user 1 2
UUID=03d31702-f7cf-4fd5-aaca-7a5afc679f5e  /backup ext4 acl,relatime 1 2
Then as root
Code: Select all
mount -a
Of course /backup would need to be unmounted first for the mount -a to work or you could simply reboot.

Re: Permission for drive

PostPosted: Mar 12th, '12, 07:00
by RoyD
hi Ken

I did all the changers but to no success. I tried but the permission problem is still a problem. Every time I tried to create a new folder I get ¨Access denied to backup/test2¨

Re: Permission for drive

PostPosted: Mar 12th, '12, 07:37
by Ken-Bergen
RoyD wrote:hi Ken

I did all the changers but to no success. I tried but the permission problem is still a problem. Every time I tried to create a new folder I get ¨Access denied to backup/test2¨
I just tested and 666 doesn't allow me to create folders but 777 does. :oops:
So
Code: Select all
chmod 777 /backup
may work for you.

Re: (Solved) Permission for drive

PostPosted: Mar 13th, '12, 07:09
by RoyD
Thanks both, the 777 worked, some other issues have started but I am moving forward but that is another posting. ta Roy