Help needed: additional internal HDD, /etc/fstab, permissions

Hi folks,

I have a problem and I am on the way to become desparate… :’( … starting to hate… :wink: and I hope that you can help me out of my misery

so here it goes:

I have an additional internal harddrive, which is formated with NTFS (because of having access with Windows). I want to make regular backups on this drive, using Back in Time. But this is not possible, because there is something weired with the permissions and user stuff.

In the YaST partioning manager I have set it so that I as a normal user can mount it.

I have created a mount point named /media/Backup for the drive and it is entered in the YaST partitioner and also in the /etc/fstab.

When I now do a rightclick on this folder in Dolphin and have a look at the owner of it, I see: root. Group: users.

when I do (as root)

chown steffen:users -R /media/Backup

it tells me: no such file or directory

when I mount the drive, it tells me that it is already mounted. When I unmount it and do the same again

chown steffen:users -R /media/Backup

of course it tells me: no such file or directory.

when i mount it, it mounts it…

When I open Dolphin in administrator mode and do a rightclick on the folder /media/Backup, I can change the owner. But when I close it, and open it again, root is the user again!

this is my /etc/fstab

/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part3 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part1 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part2 /home                ext4       acl,user_xattr        1 2
/dev/sdc1                                                        /media               ntfs-3g       users,gid=users,umask=0002,utf8=true 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part1 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part2 /windows/D           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part4 /windows/E           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part5 /windows/F           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

the drive I mean is /dev/sdc1.

I also changed the /etc/fstab already some times, to try to get this to work. But this is the original one, which does not work, as the others too…

I also have created a new mount point for the drive, inside my home directory (hoping that this root-**** ends with that): /home/steffen/Backup.
after putting the mount point into /etc/fstab and a reboot, /home/steffen/Backup is owned by… guess whom… root of course.

So whats wrong here? Can someone please give me the right line to put into /etc/fstab?

I am a bit pi**ed right now because I spent 2 days on that and did not find a hint on google and I have no idea whats going on here… may I am too stupid for the holy grail of Linux users permissions…

thats why sorry, if this post is a bit hard. Would be great if someone of you could help me please.

Thanks!
Steffen

Just an idea, since I do not work with NTFS-partitions: NTFS is not able to handle the unixoid rights management, I suppose that could be a reason for your troubles.

Unless you wish to back up files like .mp3s, images, videos etc., I recommend to use a partition with an unixoid filesystem instead. When it comes to things like configuration files or the like, NTFS will fail to prevent the rights.

–Edit: I agree with the previous poster, use a native file system if you can. If not see below –

First, to be clear Linux doesn’t really do NTFS permissions so you have to specify permissions for the whole volume on mount, but I think you got that. I’m going to assume that your on a single user system and don’t really care if the users group has write permissions on the volume.

Your /etc/fstab line:


/dev/sdc1                                                        /media               ntfs-3g       users,gid=users,umask=0002,utf8=true 0 0

  • This mount the volume as /media but you probably don’t really want to do that, /media serves a special purpose as a place the system uses to create a mount point for removable media. I’d create a /backup directory and mount it there instead.

  • The section that reads “users,gid=users,umask=0002,utf8=true” has only one issue that I see, the umask has 1 too many zeros, but I’d take a hint from the next line in your fstab:


/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part1 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0

This uses an fmask and a dmask (so that directories are executable, but files are not) but disallows writing to the group, so using the mount options from this line but modifying the masks should do the job:


/dev/sdc1        /backup               ntfs-3g     users,gid=users,fmask=113,dmask=002,locale=de_DE.UTF-8   0 0

This should mount the volume as /backup with an owner for “root”, but a group of “users” that has write permissions. Just remember that you need to create the mount point before you reboot:


su -
mkdir /backup

thanks guys for your answers!

I just want to backup .mp3´s, documents and videos and stuff. But I normally don´t mind what filesystem is used. I just thought that access via Windows would be cool…

One doubt: when I have the /backup directory with owner root, but write permissions, then I am concerned that Back in time won´t make it. Because I thought that I already had write permissions, but Back-in-Time has thrown error messages at approx. half of the backuped files, some were written, some not… this was the main reason to have me, the normal user as the owner…

ah… and yes, it is a single user system.

anyway, I´ll try it and come back.

Thank you very much!

I tried it with Back-in-Time… nope, does not really work…

It always throws the error message "failed to set times on /file…/… operation not permitted. So I think, it screws the backup.

So, if I then re-format the drive, to ext4, what is the /etc/fstab line then? Do I need to observe something in the YaST partioner?

On 2011-05-21 04:06, steffen13 wrote:

> I have created a mount point named /media/Backup for the drive and it
> is entered in the YaST partitioner and also in the /etc/fstab.

Do not create mountpoints in /media, use /mnt. /media is for the automatics.

> When I open Dolphin in administrator mode and do a rightclick on the
> folder /media/Backup, I can change the owner. But when I close it, and
> open it again, root is the user again!

That’s correct. You can not change the owner on msdos filesystems.

> /dev/sdc1 /media ntfs-3g users,gid=users,umask=0002,utf8=true 0 0

Don’t do that! This will break all the automounter system. Leave “/media”
alone. You may mount on /media/something, but never on “/media”!

> So whats wrong here? Can someone please give me the right line to put
> into /etc/fstab?

Add the option “uid=myusername” and it will belong to you. Easy.

> I am a bit pi**ed right now because I spent 2 days on that and did not
> find a hint on google and I have no idea whats going on here… may I am
> too stupid for the holy grail of Linux users permissions…

Read the man, man… >:-P

(sorry!)


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

On 2011-05-21 04:36, unamanic wrote:
> Just remember that you
> need to create the mount point before you reboot:

Don’t reboot.

Just umount the partition before editing fstab, and mount it again after
editing fstab.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Why not give this a try. If you copy and past this, be sure to pop it into kwrite first and then to your fstab file.

/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part3 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part1 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part2 /home                ext4       acl,user_xattr        1 2
/dev/sdc1                                                        /media               ntfs-3g       defaults 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part1 /windows/C           ntfs-3g    defaults 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part2 /windows/D           ntfs-3g    defaults 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part4 /windows/E           ntfs-3g    defaults 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part5 /windows/F           ntfs-3g    defaults 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

I am not sure I like the setup on /dev/sdc1 and I would likely remove it and then use the YaST Partitioner to change it to /windows/G and using its disk/by-id just like everything else. Give this setup a try and let us know of your success.

Thank You,

this

Add the option “uid=myusername” and it will belong to you. Easy.

was the solution!

As far as I can see, no errors anymore and the drive is all mine!

yours, @jdmcdaniel3 did not work. Same result as before.

so my fstab is now:

/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part3 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part1 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-ST32000641AS_9WM430DV-part2 /home                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-Hitachi_HDS721010CLA332_JP2940HD15WW1C-part1 /backup        ntfs-3g       users,uid=steffen,gid=users,fmask=113,dmask=002,locale=de_DE.UTF-8 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part1 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part2 /windows/D           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part4 /windows/E           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0
/dev/disk/by-id/ata-ST3750528AS_9VP869PK-part5 /windows/F           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=de_DE.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

as you can see, a mix from unamanic and robin_listas hints.

Thanks guys!

Read the man, man… >:-P

(sorry!)

no worries. If I only would understand them, but I am so stupid about these system things, that after reading man´s I am as stupid as before… :smiley:

On 2011-05-21 06:06, steffen13 wrote:
>
> as you can see, a mix from unamanic and robin_listas hints.
>
> Thanks guys!

Welcome :slight_smile:

>> > Read the man, man… >:-P
>> >
>> > (sorry!)
> no worries. If I only would understand them, but I am so stupid about
> these system things, that after reading man´s I am as stupid as
> before… :smiley:

No surprise, really, the “man” reading material is often difficult to
understand. They seem to be designed for people that already know that
stuff and only need a reminder. Quite difficult to learn how to use a
program from the start.

A book is better.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)