Neville wrote:Perhaps you could explain the meaning of each command.
I fear you will regret this
- Code: Select all
sudo blkid -c /dev/null
That will list all of your partitions mounted or not that are connected to your machine. A sample line would look something like this:
/dev/sda3: LABEL="Common" UUID="DA9056C19056A3B3" TYPE="ntfs"
- Code: Select all
sudo mkdir /media/WinD
mkdir = make directory. It's the command to create a directory at that given location. Since the location is within /media you need to be sudo to do that.
UUID=DA9056C19056A3B3 /media/WinD ntfs defaults,nls=utf8,umask=000,uid=1000,windows_names 0 0
The general syntax of a line in fstab is as follows:
[device] [mountpoint] [filesystem] [options]So in the line above:
device = UUID=DA9056C19056A3B3: a unique identifying number for that partition.
mountpoint = /media/WinD: It's the location where your partition can be accessed.
filesystem = ntfs
options = defaults,nls=utf8,umask=000,uid=1000,windows_names 0 0
defaults : A general set of default mount parameters that determines if the partition will automount, is executable, root controlled, etc..
nls=utf8 : has to do with character encoding so that it can handle all the characters in the file name.
uid : The id number of the user that you want to have as owner of the mounted partition. "1000" is you so uid=1000 makes you the owner of the mounted partition.
windows_names : You can create in Linux a file with a name that has characters Windows does not recognize ( special characters ). This option prevents you from doing that.
umask:From a Linux perspective an NTFS partition in it's raw state has permissions of 777 - drwxrwxrwx. Umask represents the permissions that you want to mask or remove from the "view" you create when you mount it. Each position represents a type of user:
1st position: The owning
user of the partition
2nd position: The
group that you want to allow access.
3rd position: All
other users.
Each number represents a type of permission that you want to remove:
0 = nothing is masked or removed
1 = execute is removed ( you do not want ot remove execute on a directory )
2 = removes write
4 = removes read
They are additive so a 7 ( 1+2+4 ) removes all access for example.
So the line I suggest as a template will mount the partition to /media/WinD with you as owner, root as group ( the default unless you specify otherwise ), and permissions allowing everyone to access it.
- Code: Select all
sudo mount -a
That command does 2 things. It will mount any partition that is not currently mounted by following the instructions in fstab. But in doing so it will uncover any mistakes you have made ( typo in the UUID, there is no /media/WinD, it's not really ntfs, etc... ). It's easier to correct any mistakes before you reboot than to find out at boot.
Note: This template is for NTFS partitions. The template for an ext3/4 partition is a lot simpler since you don't ( can't ) specify owner, group, or permissions in fstab for Linux filesystems.