Help - Search - Members - Calendar
Full Version: Using external USB disks and Linux partitions
MandrivaUsers.org > General Help > Tips and Tricks
ianw1974
I'd recently decided to drop FAT32/NTFS from my external 160GB disk, because of accessibility problems. FAT32 isn't good for disks larger than 30GB and isn't great anyway because of defragmentation. NTFS was better, but found that depending on my distro, I wouldn't generally have write support unless NTFS-3G was installed. Both use umask=0 to get around problems with normal users reading/writing to the disk.

I've since changed it to ext3, and found that by default, since root is mounting it via udev, that the disk was read-only for my one particular user. I don't have any other users, which is why I never fixed the permissioning under udev, or wrote my own rule. A nice simple way though is this.

1. Plug your disk to your computer, udev will then auto-mount it to /media/disk or whatever.
2. Change the permissions by doing:

CODE
chown -R username:username /media/disk
chmod -R 775 /media/disk


now, I can access the disk, and all files are owned by me. Any other users could essentially save here since I changed read/write/execute permissions on the disk. Simple, yet effective. I chose ext3 as the partition, because I can use the ext2ifs driver in Windows if I want to mount and access the disk. Under Windows though, it's read as ext2, so if you did use ext3, you have to make sure the disk was unmounted properly, otherwise Windows won't read it. But then, the same happens to NTFS partitions if you didn't unmount them safely in Windows first.

Obviously, replace username with your username.
pindakoe
Is this permanent, i.e. what happens if you disconnect the external harddisk and remount it later or after a reboot. Is /media/disk still owned by username:username or does it get re-created by udev (which I think is what is hapening)? I haven't really gotten my arms around udev rules, so any starting points appreciated.
ianw1974
Yes, it's still owned by username:username, at least it was for me. I didn't do anything else, other than what I did here, and it always kept the username:username and permissions.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.