Let’s become superuser:
Get the unique identifier for each HDD:
/dev/sda1: UUID="B4DE6B45DE6AFECC" TYPE="ntfs" PARTUUID="1bee7e3a-01" /dev/sda2: LABEL="STORAGE" UUID="5407-7192" TYPE="vfat" PARTUUID="1bee7e3a-02" /dev/sda3: UUID="0a716fbe-6568-4727-9e99-5971c18c4643" TYPE="ext4" PARTUUID="1bee7e3a-03" /dev/sda4: UUID="e754578d-b6bb-4acf-9949-1ad30653579e" TYPE="swap" PARTUUID="1bee7e3a-04" /dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="c3203f99-18a3-464d-8e6c-26c044f6ab6b" /dev/sdb2: LABEL="TOSHIBA EXT" UUID="B0922E94922E5F5A" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b5dbf614-0ec8-4b50-be08-fd4e12f9f22a"
gedit /etc/fstab &
In that file, add:
UUID="B4DE6B45DE6AFECC" /media/C ntfs-3g errors=force UUID="5407-7192" /media/D vfat rw,umask=0000
The rw,umask=0000 for FAT32 and errors=force for the NTFS drive is required to get read write access on the drive. If ntfs is used instead of ntfs-3g, again, we get only read access.
To mount from this file right now, run:
sudo mount -a
According to arch wiki,
Quoting a bit from the Ubuntu manual
The file opened contains lines of the form
The first field, (fs_spec), describes the block special device or remote filesystem to be mounted.
For ordinary mounts it will hold (a link to) a block special device node (as created by mknod(8)) for the device to be mounted, like /dev/cdrom or /dev/sdb7. For NFS mounts one will have
Instead of giving the device explicitly, one may indicate the (ext2 or xfs) filesystem that is to be mounted by its UUID or volume label (cf. e2label(8) or xfs_admin(8)), writing LABEL=
The second field, (fs_file), describes the mount point for the filesystem. For swap partitions, this field should be specified as none. If the name of the mount point contains spaces these can be escaped as \040.
The third field, (fs_vfstype), describes the type of the filesystem. Linux supports lots of filesystem types, such as adfs, affs, autofs, coda, coherent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, umsdos, vfat, xenix, xfs, and possibly others. For more details, see mount(8). For the filesystems currently supported by the running kernel, see /proc/filesystems. An entry swap denotes a file or partition to be used for swapping, cf. swapon(8). An entry ignore causes the line to be ignored. This is useful to show disk partitions which are currently unused.
The fourth field, (fs_mntops), describes the mount options associated with the filesystem.
It is formatted as a comma separated list of options. It contains at least the type of mount plus any additional options appropriate to the filesystem type. For documentation on the available options for non-nfs file systems, see mount(8). For documention on all nfs-specific options have a look at nfs(5). Common for all types of file system are the options noauto (do not mount when “mount -a” is given, e.g., at boot time), user (allow a user to mount), and owner (allow device owner to mount), and comment (e.g., for use by fstab-maintaining programs). The owner and comment options are Linux-specific. For more details, see mount(8).
The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.
The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.
To learn more about options, type ‘man mount’.
Accessible by everyone
Accessible by a subset of users**
*If you want write access to your file system, you should set the filesystem type to ‘ntfs-3g’ instead of ‘ntfs’. You may need to install the package ‘ntfs-3g’ for this to work, so make sure it is installed before you use ntfs-3g.
**uid=1000 restricts access to the user created while installing Ubuntu. 1001 is the user created after that, and so forth. gid=# may be used with or in place of uid to grant access to a group. However, group and user enumeration is beyond the scope of this article.
Note for international users: if your filesystem contains funny symbols, you may need to add an option for utf-8 support.
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.