how to create an ext2 partition from command line which is writable from every user
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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
will let any user write to the drive. EDIT: You do this when the drive is mounted, and as root. Permissions on the mountpoint directory when the drive is not mounted have no effect once it is mounted.
Erm...you just change the permissions on the drive.
Code:
chmod ugo+rwX /media/drive
will let any user write to the drive. EDIT: You do this when the drive is mounted, and as root. Permissions on the mountpoint directory when the drive is not mounted have no effect once it is mounted.
Sweet my friend you have answered my question as well!
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"?
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
You probably CAN do what you're describing, but I'm not sure why you need to. For an ext2 drive - or any other Linux format - you can simply set the permissions on the DRIVE so that anyone can write to it, regardless of who the owner is. Those permissions remain whatever Linux system you connect the drive to.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.