Jump to content
Sign in to follow this  
ianw1974

Using external USB disks and Linux partitions

Recommended Posts

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:

 

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...