how to create an ext2 partition from command line which is writable from every user
Hi,
I work with a Debian Squeeze on my laptop and I have a 160GB external hard disk. My hard disk was formatted FAT32, but I decided to format it using ext2. I formatted it using fdisk from command line and everything went well. Unfortunately, when I mount my hard drive(which is auto-mounted from Debian) it has got root both as owner and group. Then I can't write to it because I have no permission to do that. Is there a setting to create an ext2 partition which has as owner the logged system user in order to have right permission every time. I hope you have a solution! |
welcome to LQ!!
We have many solutions!!!---possibly more than you want....;) First, there are three distinct steps: 1. Create the partition 2. Format it with a filesystem 3. Mount it to the system tree To create: fdisk, cfdisk, GParted, and many more (these tools typically do not do formatting.) To format: mkfs (eg: mkfs.ext3 or mkfs.msdos) To mount: (create a mount point, and then) mount To mount automatically: edit /etc/fstab Normally, to set permissions, you would set them for the mount point. I think you can do this before or after mounting, but I have not played with this for a while. |
Erm...you just change the permissions on the drive.
Code:
chmod ugo+rwX /media/drive |
Quote:
|
Thanks for your well-timed answers!
Perhaps I bad explained my point. If a create a mount point and after I mount the hard drive to that mount point I have the root permission yet. However, if I change the owner to user1 (for instance) on my hard disk, I could read and write everything. Unfortunately, if I connect my hard drive to a different laptop which has user2 as logged user, I can't write on the hard disk because of I haven't permission as well!!! Is there any settings to say "each time the system auto-mount the hard drive has to assign the logged user as hard disk owner"? How could I fix that??? Thanks |
How are you doing the mounting? Do you have an entry in your fstab? I achieve what you seem to be describing with an fstab entry like:
/dev/foo /media/foo auto defaults,user,noauto 0 0 Then, the user can just type 'mount /media/foo' Evo2. |
Quote:
|
Hi,
I finished to give all permission to my hard hard drive as cantab said. In that way every user has got permission on what it creates, that's fine for me. Thanks to everyone! |
All times are GMT -5. The time now is 03:16 PM. |