What Options are Needed for Mounting Drives?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
BCL

What Options are Needed for Mounting Drives?

Post by BCL »

Hi All,

I currently duel boot with Mint 13 (but I don't think that's important for this question).

Though Mint allows me to access my other partitions after I've booted, I would like them mounted at boot time so that some files are available to the system.

Researching how they are mounted at present by the system, I've found the following:

Code: Select all

/dev/sda3		/media/Windows_			fuseblk 					(rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)
/dev/sda4		/media/LMDE_				ext4 					(rw,nosuid,nodev,uhelper=udisks)
If I put these in the /etc/fstab file, would they look like this?

Code: Select all

/dev/sda3     /mnt/Windows    ntfs    rw,exec,nosuid,nodev,uid=1000,gid=1000,windows_names,allow_other,default_permissions,blksize=4096       0       0
/dev/sda4     /mnt/LMDE       ext4    rw,exec,nosuid,nodev,uid=1000,gid=1000,uhelper=udisks   0       0
{Someone on this forum also suggested the 'windows_names' option for the ntfs drive; probably a good idea.}

These options are not mentioned in the man pages on fstab and mount:
  • allow_other
  • default_permissions
  • blksize=4096
  • uhelper=udisks
Do I need them? Or should I use lines like:

Code: Select all

/dev/sda3     /media/Win      ntfs    default,rw,user,exec    0       0
/dev/sda4     /mnt/LMDE       ext4    defaults,rw,exec   0       0
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: What Options are Needed for Mounting Drives?

Post by altair4 »

Most of the options you listed come from fuse and udisks/udisks2 not from mount and are interpreted. The classic way to mount these partitions is represented by these templates:
UUID=DA9056C19056A3B3 /media/Win ntfs defaults,nls=utf8,umask=000,uid=1000,windows_names 0 0
UUID=076426af-cbc5-4966-8cd4-af0f5c879646 /mnt/LMDE ext4 defaults,noatime 0 2
defaults = contains the following options: rw, suid, dev, exec, auto, nouser, async, and relatime. There is no need to state them again and there is no need to override them unless there is an extraordinary need.

NTFS is different from a Linux filesystem in that you specify ownership ( uid=1000 ) and permissions ( umask=000 ) in the mount command itself whereas in Linux filesystems you specify that after the partition is mounted. Other ntfs specific options are available such as "windows_names" which prevents the user from creating a file with a name containing characters Windows cannot interpret.

The mounting of an NTFS partition in Linux creates an immutable "view" of that partition such that it appears to have Linux ownership and permissions bits when in fact it has neither.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
BCL

Re: What Options are Needed for Mounting Drives?

Post by BCL »

Thank you. That seems to be working well now. :)

One more quick question:
In the mount options list, does the order of the options matter? Because I found that options like 'defaults' and 'user' conflict in their write-ups, each saying that the opposite states for dev, suid and exec.
defaults -- use default options: rw, suid, dev, exec, auto, nouser, and async.
user -- This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid).
So that, "defaults,user" would have a different result than "user,defaults"; yes?
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: What Options are Needed for Mounting Drives?

Post by altair4 »

You are quite correct. Order does matter for the exact reason you posted. You did however choose a bad example since adding "user" to fstab serves no practical purpose.

"user" determines who can mount and then unmount the partition. If you look at the description of "user":
Allow an ordinary user to mount the filesystem. The name of the mounting user is written to mtab so that he can unmount the filesystem again.
First of all it very much does not allow an ordinary user to mount the partition if someone else mounted it first for the reason explained by the next sentence in the description above. When you boot into the system the only user at the moment fstab is read is root. So root mounted it and only root can unmount it. The practical result of adding "user" is the exact same as leaving it at "nouser":
Forbid an ordinary (i.e., non-root) user to mount the filesystem. This is the default.
The whole reason for having entries in fstab is to have these partitions permanently mounted at boot. Why would you want anyone other than root to be in control of the mount process for these partitions.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
BCL

Re: What Options are Needed for Mounting Drives? [SOLVED]

Post by BCL »

Thank you. You were most helpful.

:D
Locked

Return to “Storage”