• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Mounting in Linux question

Imaginer

Diamond Member
I have used the mount command as follows under a konsole window in Debian.

mount -t ntfs -r /dev/hda1 winxp

where winxp is the folder i created to mount my Windows XP drive to.

I can see everything fine under root and run everything fine under the root account, problem is, i want to be able to mount so that other accounts (such as my non root one) to be able to see it.

Since i can't use the mount command under anything else but root, i have tried changing the groups my non root account was in and even making it root itself but it would not work that way. Even with the it under the root group, it can't use the mount command.

I know you can edit the fstab but i don't want to make anything permanent just yet.

Any help would be appreciated.
 
As far as working with a mounted partition as a non-root user, you should read the manpage for mount. It includes the flags tomount it for use as a user and/or a particular group (probably -u and -g, but dont quote me on that).

Mounting a filesystem as a non-root user might be tougher... You can change permissions on the target folder and mount to let its group execute it. Thats what I would try first anyhow. "chmod 750 whatever" maybe.
 
In my experiance you can't change the permissions of a partition itself once it is mounted, It will be owned by whoever mounted it, however If you are mounting a Windows partition (i know this from vfat not ntfs) you can run into some serious problems with permisions, because the MS partition won't support Linux's file permisions.

The easiest way to deal with this is to go into /etc/fstab and add: 'user' to the ntfs partition's options (do a 'man fstab' for instructions). That sould give whatever user mounted it full rights to the MS partition. The only trouble is you have to mount the partition manually, but typing 'mount /windows' is about easy as it gets.

hope it helps ya.
 
Originally posted by: drag
In my experiance you can't change the permissions of a partition itself once it is mounted, It will be owned by whoever mounted it, however If you are mounting a Windows partition (i know this from vfat not ntfs) you can run into some serious problems with permisions, because the MS partition won't support Linux's file permisions.

The easiest way to deal with this is to go into /etc/fstab and add: 'user' to the ntfs partition's options (do a 'man fstab' for instructions). That sould give whatever user mounted it full rights to the MS partition. The only trouble is you have to mount the partition manually, but typing 'mount /windows' is about easy as it gets.

hope it helps ya.

Im trying to edit the fstab now and from looking at how vi is done, i cant seem to let it add another line below the lists of drives and devices.

So it is possible to mount but as a non-root? Is it that difficult or should i have to get use to switching to root and back?
 
ya it should be possible....

vi is bit tricky at first.
One thing that helped me out was: if you press "i" while in command mode you will begin to insert text BEFORE the prompt, if you press "a" while in command mode you will begin to insert text AFTER the prompt, so if you want add a new line a easy way (there are other ways) is press ESC to make sure you are in command mode and not typing mode, move cursor all the way to the end of a line (press "l"(lowercase L) button if arrow keys are not working) and press "a" and then enter to create a newline.....

If you are having trouble with vi don't worry about it. Try starting x in root and use a gui text editor to edit the /etc/fstab file.

Learn to use Vi is very frustrating at first, but it is worth it because if get good typing skills it is set up to do everything without you having to move your hands from the proper typing position. If you spend time at it you can become a very fast at it, faster than using a mouse. This is good if you want to program any. If you don't care about it just get use to it, a text based text editor is used often and vi is pretty much universal among all *nix's.

here is a copy of my fstab

/dev/hdd1 swap swap defaults 0 0
/dev/hda1 / ext2 defaults 1 1
/dev/hdd2 /usr/local ext2 defaults 1 2
/dev/hdb1 /win vfat noauto,user 1 2
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0

the /dev/hdb1 is my windows partition (i don't use it much, I just wanted it to play with wine) 😉
its win98 and uses vfat (or otherwise known as fat32). Since vfat doesn't support linux file permisions this is the easiest way I can get it to work....

I guess ntfs is not quite fully supported by Linux 🙁
I just noticed that they have a good FAQ reference on the thread: The great AT Linux/BSD/*NIX FAQ project!
maybe you sould check it out.....
 
Back
Top