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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What is the correct fstab entry to manually mount a Windows XP ntfs type partition? All my Linux and other partitions were auto-mounting, then I did edit the /etc/fstab file to change from "defaults", to "noauto,user" options, and changed the mount point folders from; /media/disk-1 (and so on numbers), to; /sda1, and so on for all 10 partitions. Now I can mount all the Linux partitions fine, but not any NTFS, so what is the secret?
Should I use; auto, or ntfs, or does ntfs-3g work to manually mount these type partitions ?
ntfs-3g will manually mount the partition... (did you RTFM?) use it in place of your usual mount command.
You have neglected to tell us what it is that you are having trouble with when mounting. What command are you using? Do you get any errors? In what way does the mount not procede as expected?
Your mounting scheme is not a good idea - you should not have user-writable files right off root. The organisation with /media /mnt etc is done for a reason and is kept because the reasons remain valid. You will have fewer problems in the long run if you stick with it.
OTOH, changing /media/disk-1 to something descriptive like /media/windows is a good idea.
I think this should do:
/dev/sda6 /home/username/windows ntfs-3g rw,noauto,exec,dev,suid,uid=1000,gid=1000,umask=0011 0 0
(you need to create a windows folder in your home directory first)
Will the uid and gid entries allow any user to mount, or just the first user?
This is something I missed earlier - but the user flag instead aught to do the trick.
It is usual, though, just to automount the fs to allow users to access it.
simon bridge; What is RTFM, and how is that used. I have sda6 as a NTFS storage partition, and sdb1 is windows XP formatted also as NTFS. What I do is in gnome Fedora 9, I open the "Disk Management", (the mount tool), and select a partition and click the mount button. Then for a ntfs there is no result, (it does nothing at all), and no error message either. But for any Linux it does mount and unmount just fine. I am not doing this in a terminal by command line, just by edit of the; /etc/fstab file, thanks.
jay73; What do those numbers refer to? (uid=1000,gid=1000,umask=0011),and why can we not use auto, or ntfs as the file system type,? thanks.
Who says ntfs cannot automount? I only used noauto because you mentioned mounting manually. There is little point in mounting anything manually if it has been mounted automatically at boot time. Here are the options I use for automounting:
rw,uid=1000,gid=1000,umask=0011 (if you use, say, Fedora, you will need to use 500 instead of 1000).
@Simon Bridge
Frankly, I don't know. It seems to me that the gid and uid only emulate Linux file permissions and that they are unrelated to the mounting operation.
EDIT: I have just tried mounting NTFS as a regular user and I get this:
Unprivileged user can not mount NTFS block devices using the external FUSE
library. Either mount the volume as root, or rebuild NTFS-3G with integrated
FUSE support and make it setuid root. Please see more information at http://ntfs-3g.org/support.html#unprivileged
The acronym is referring you to the unix manual pages - which means the solution you asked for is spelled out there. If you do not know how to access these pages, enter
man man
in a terminal.
However, I may have misunderstood your request - you want any user to be able to mount, is this correct?
Quote:
I have sda6 as a NTFS storage partition, and sdb1 is windows XP formatted also as NTFS. What I do is in gnome Fedora 9, I open the "Disk Management", (the mount tool), and select a partition and click the mount button. Then for a ntfs there is no result, (it does nothing at all), and no error message either. But for any Linux it does mount and unmount just fine. I am not doing this in a terminal by command line, just by edit of the; /etc/fstab file, thanks.
Ahah! Perhaps the mount tool is not smart enough to use ntfs-3g instead of mount?
@Simon Bridge
Frankly, I don't know. It seems to me that the gid and uid only emulate Linux file permissions and that they are unrelated to the mounting operation.
From ntfs-3g(8)
Code:
uid=value and gid=value
Set the owner and the group of files and directories. The values
are numerical. The defaults are the uid and gid of the current
process.
umask=value
Set the bitmask of the file and directory permissions that are
not present. The value is given in octal. The default value is 0
which means full access to everybody.
Looks like setting uid and gid means that anyone not of the right user or group will have ro access only. I have usually just set the bitmask to 0000 (default) for single-user machines. Then it doesn't matter.
Quote:
EDIT: I have just tried mounting NTFS as a regular user and I get this:
Unprivileged user can not mount NTFS block devices using the external FUSE
library. Either mount the volume as root, or rebuild NTFS-3G with integrated
FUSE support and make it setuid root. Please see more information at http://ntfs-3g.org/support.html#unprivileged
Yes - that is correct behavior. Like mount, you have to be root to use ntfs-38.
Wait! Do you mean that you set fstab to allow user mounting (need "user" option) yet this did not work?
Have you tried:
mount -t ntfs-3g /dev/sda1 /mnt/windows
instead?
Note: from mount(8)
Code:
user Allow an ordinary user to mount the file system. The
name of the mounting user is written to mtab so that he
can unmount the file system again. This option implies
the options noexec, nosuid, and nodev (unless overridden
by subsequent options, as in the option line
user,exec,dev,suid).
Also owner and group for different control. But you don't want suid if any old mounting user needs rw access.
@OP: we do not want to set the fs to ntfs because that needs the ntfs driver, which you don't have. ntfs-3g is the program which handles MSs proprietary FS for linux. Similar for setting the fs to auto.
jurgen@Selena:~/Data/C$ mount -t ntfs-3g /dev/sdb2 /mnt/ubu
mount: only root can do that
jurgen@Selena:~/Data/C$ ntfs-3g /dev/sdb2 /mnt/ubu/
Unprivileged user can not mount NTFS block devices using the external FUSE
library. Either mount the volume as root, or rebuild NTFS-3G with integrated
FUSE support and make it setuid root. Please see more information at http://ntfs-3g.org/support.html#unprivileged
Thanks for all the help, I think I will just allow the auto mount of all my NTFS partitions (only 2), and that is the simple and easy way. And here is a good ntfs-3g site; http://ntfs-3g.org/index.html
@jay27 - that is a useful discovery - thanks. Sadly I cannot duplicate this as my own ntfs partitions have been erased long ago. But it appears that ntfs-3g does not behave just as mount does. It is inadvisable to let users have access to anything setuid root.
@james2B: that's what I did.
@matrix13: isn't that line a comment? Anyway, the idea is not merely to mount the partition but to allow non-root users to mount and unmount it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.