Hi everyone,
I just bought a 1TB WD Passport. It came formatted as NTFS, on plugging it in, it auto-mounted as the regular user. But after I formatted it to use ext4 (with gparted), it keeps getting auto-mounted as root both on F13 and F14. Any ideas what I could do about this?
On 26 March 2011 06:37, Suvayu Ali fatkasuvayu+linux@gmail.com wrote:
Hi everyone,
I just bought a 1TB WD Passport. It came formatted as NTFS, on plugging it in, it auto-mounted as the regular user. But after I formatted it to use ext4 (with gparted), it keeps getting auto-mounted as root both on F13 and F14. Any ideas what I could do about this?
-- Suvayu
Open source is the future. It sets us free.
What about writing udev rule?
On 03/25/2011 08:37 PM, Suvayu Ali wrote:
Hi everyone,
I just bought a 1TB WD Passport. It came formatted as NTFS, on plugging it in, it auto-mounted as the regular user. But after I formatted it to use ext4 (with gparted), it keeps getting auto-mounted as root both on F13 and F14. Any ideas what I could do about this?
Udev is the daemon that associated a drive name in /dev with a physical drive. You have a choice of either using uuids or make udev rules for each drive.
On 03/26/2011 11:37 AM, Suvayu Ali wrote:
Hi everyone,
I just bought a 1TB WD Passport. It came formatted as NTFS, on plugging it in, it auto-mounted as the regular user. But after I formatted it to use ext4 (with gparted), it keeps getting auto-mounted as root both on F13 and F14. Any ideas what I could do about this?
I've not done this in a while...and certainly not with having the drive auto-mounted (habit, no other reason).
But, since my system is a single user system I've always just cd to /media or /mnt and then just chown myuid:mygroup mntpoint after doing the mkfs and after mounting it the first time.
Since my external drives were all ext3 they just come up as being owned my me from that point on.
Hi Hiisi and JB,
On Fri, Mar 25, 2011 at 9:07 PM, JD jd1008@gmail.com wrote:
On 03/25/2011 08:37 PM, Suvayu Ali wrote:
Hi everyone,
I just bought a 1TB WD Passport. It came formatted as NTFS, on plugging it in, it auto-mounted as the regular user. But after I formatted it to use ext4 (with gparted), it keeps getting auto-mounted as root both on F13 and F14. Any ideas what I could do about this?
Udev is the daemon that associated a drive name in /dev with a physical drive. You have a choice of either using uuids or make udev rules for each drive.
I presume by uuids you mean put it in my fstab? And wouldn't udev rules be machine specific too? Doesn't either of these defeat the purpose of portable external drives? I would have to do this one all my current systems, and all future systems I wish to use these drives with?
I was hoping there would be a more generic solution. I am surprised since my USB flash drives are auto-mounted as regular user just fine.
On 03/25/2011 10:37 PM, Suvayu Ali wrote:
Hi everyone,
I just bought a 1TB WD Passport. It came formatted as NTFS, on plugging it in, it auto-mounted as the regular user. But after I formatted it to use ext4 (with gparted), it keeps getting auto-mounted as root both on F13 and F14. Any ideas what I could do about this?
Are you talking about the ownership of the root directory on the mounted file system? That's stored in the directory's inode, just as with any other directory. With the file system mounted, use 'chown' (as root) to change that ownership to anything you want. Note that it's only the numeric UID and GID that are stored. If you're moving that drive among systems with different UID/GID->name mappings, you'll see different user names as the owner.
On 03/25/2011 09:47 PM, suvayu ali wrote:
Hi Hiisi and JB,
On Fri, Mar 25, 2011 at 9:07 PM, JDjd1008@gmail.com wrote:
On 03/25/2011 08:37 PM, Suvayu Ali wrote:
Hi everyone,
I just bought a 1TB WD Passport. It came formatted as NTFS, on plugging it in, it auto-mounted as the regular user. But after I formatted it to use ext4 (with gparted), it keeps getting auto-mounted as root both on F13 and F14. Any ideas what I could do about this?
Udev is the daemon that associated a drive name in /dev with a physical drive. You have a choice of either using uuids or make udev rules for each drive.
I presume by uuids you mean put it in my fstab? And wouldn't udev rules be machine specific too? Doesn't either of these defeat the purpose of portable external drives? I would have to do this one all my current systems, and all future systems I wish to use these drives with?
I was hoping there would be a more generic solution. I am surprised since my USB flash drives are auto-mounted as regular user just fine.
uuid's are supposed to be universal - but I am not sure what that means.
From the man page:
OSSP uuid - Universally Unique Identifier Command-Line Tool
That said, I do not know of any way that will let you connect your drive to any (Linux?) system and expect it to be automounted onto some specific mount point (assuming the mount point exists).
Hi Ed,
On Fri, Mar 25, 2011 at 9:46 PM, Ed Greshko Ed.Greshko@greshko.com wrote:
But, since my system is a single user system I've always just cd to /media or /mnt and then just chown myuid:mygroup mntpoint after doing the mkfs and after mounting it the first time.
Since my external drives were all ext3 they just come up as being owned my me from that point on.
Thanks a lot! This should have occurred to me. :-p Works like a charm. Maybe it would be a worthwhile feature request for gparted to ask do this when formatting an external drive.
On Fri, Mar 25, 2011 at 9:59 PM, Robert Nichols rnicholsNOSPAM@comcast.net wrote:
Are you talking about the ownership of the root directory on the mounted file system? That's stored in the directory's inode, just as with any other directory. With the file system mounted, use 'chown' (as root) to change that ownership to anything you want. Note that it's only the numeric UID and GID that are stored. If you're moving that drive among systems with different UID/GID->name mappings, you'll see different user names as the owner.
I was talking about the top level directory on the partitions of the external drive. I couldn't write to it as the regular user. Following Ed's trick to chown the first time retains it for subsequent mounts on different systems.
Hi JD,
On Fri, Mar 25, 2011 at 10:04 PM, JD jd1008@gmail.com wrote:
uuid's are supposed to be universal - but I am not sure what that means.
From the man page:
OSSP uuid - Universally Unique Identifier Command-Line Tool
Yes I was aware of that. That is why I asked if you meant for me to use it in the fstab.
That said, I do not know of any way that will let you connect your drive to any (Linux?) system and expect it to be automounted onto some specific mount point (assuming the mount point exists).
I was not talking about mount points. As far as I understand the mount points are automatically generated from the device labels and mounted under /media/<label>/ for removable media. My issue was the top level directory on my removable drive was not writeable as the regular user. Follow Ed's tip of chowning the first time does the trick. On subsequent mounts on different systems the permissions are retained.
Thanks every one who replied. My issue has been solved. :)
On Saturday, March 26, 2011 01:04:31 am JD wrote:
That said, I do not know of any way that will let you connect your drive to any (Linux?) system and expect it to be automounted onto some specific mount point (assuming the mount point exists).
F14 at least will take an ext4 formatted disk and automount it to /media/$LABEL where the label is set with e2label. Likewise with any filesystem F14 supports, using the filesystem-appropriate label utility.
As to ownership, you have to set that after it's mounted with the normal filesystem tools.
Example: [root@localhost ~]# mount [snip] /dev/sdb1 on /media/wd500gbu3-bak type ext4 (rw,nosuid,nodev) [root@localhost ~]# e2label /dev/sdb1 wd500gbu3-bak [root@localhost ~]#dmesg [snip] [ 27.017416] usb 6-1: new SuperSpeed USB device using xhci_hcd and address 2 [ 27.029856] xhci_hcd 0000:0d:00.0: WARN: short transfer on control ep [ 27.030227] xhci_hcd 0000:0d:00.0: WARN: short transfer on control ep [ 27.030609] xhci_hcd 0000:0d:00.0: WARN: short transfer on control ep [ 27.031094] xhci_hcd 0000:0d:00.0: WARN: short transfer on control ep [ 27.031281] usb 6-1: New USB device found, idVendor=1058, idProduct=0730 [ 27.031290] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 27.031297] usb 6-1: Product: My Passport 0730 [ 27.031301] usb 6-1: Manufacturer: Western Digital [ 27.031306] usb 6-1: SerialNumber: YOUDIDNTTHINKIDLEAVETHISHEREDIDYOU [ 27.121613] Initializing USB Mass Storage driver... [ 27.121766] scsi2 : usb-storage 6-1:1.0 [ 27.121876] usbcore: registered new interface driver usb-storage [ 27.121879] USB Mass Storage support registered. [ 29.104203] scsi 2:0:0:0: Direct-Access WD My Passport 0730 1012 PQ: 0 ANSI: 6 [ 29.104608] scsi 2:0:0:1: Enclosure WD SES Device 1012 PQ: 0 ANSI: 6 [ 29.107469] sd 2:0:0:0: Attached scsi generic sg2 type 0 [ 29.107640] scsi 2:0:0:1: Attached scsi generic sg3 type 13 [ 32.934134] sd 2:0:0:0: [sdb] 976707584 512-byte logical blocks: (500 GB/465 GiB) [snip]
Works just like automount of a USB flash drive does.