|
10 years ago 8 |
auto mounting partitions is very easy in linuxmint with the disk utility which have a nice gui explaining everyting.
but now i am going to show you a staright forward process of automonting partitions by editing /etc/fstab file.
this tutorial is not solely for automounting but how to edit fstab efficiently and gaining some knowledge about it.
steps:
1. sudo gedit /etc/fstab
2. now the fstab file is open in gedit. you need to add an entry for the partition to automount it at startup.
the format of a new entry is like this:
file_system mount_point type options dump pass
you will see this in the file and you need to add your new entry under this line.
brief explanation of the above format:
1.file_system = your device id.
use this:
/dev/sdax ( you should check it with sudo fdisk -l)
it may be /dev/sdbx or /dev/sdcx if you have more than one disks connected.
2. mount_point =where you want to mount your partition.
use this:
/media/user/label
here user is your user name, label is "software", "movies" or whatever label your partiton have.
3. type=fat32,ntfs, ntfs-3g,ext2,ext4 or whatever your partition type is.
4. options =mount options for the partition(explained later).
5. dump=Enable or disable backing up of the device/partition .usually set to 0, which disables it.
6. pass =Controls the order in which fsck checks the device/partition for errors at boot time. The root device should be 1. Other partitions should be 2, or 0 to disable checking.
so for auto mounting case the above format reduces to:
/dev/sdax /media/user/label type options 0 0
(you can check the type with sudo fdisk -l)
the options field:
now the final format reduces to (for auto mount):
/dev/sdax /media/user/label type defaults 0 0
for ntfs
/dev/sdax /media/user/label ntfs defaults 0 0
for ext4
/dev/sdax /media/user/label ext4 defaults 0 0
etc.....
you can change defaults by your own configuration, like
/dev/sdax /media/user/label ext4 rw,suid,dev,noexec,auto,user,async 0 0
etc...
you need to add entry for each partiton you want to auto mount.
3. save and exit the file then restart and see the result.
for more information visit the links below:
The instructions are fine, and work ... thanks! HOWEVER, doing so disables Tab Autocomplete for the mounted entries. I was almost sure my Linux Mint 18.3 'Sylvia' MATE was defective, and about to reinstall, when I troubleshooted it. Hope this helps.
As said in the fstab file, you can use "UUID= as a more robust way to name devices, that works even if disks are added and removed."
Now to get that UUID it's very easy :
-get your device's name (e.g. /dev/sda2) with the disk utility gui, or with sudo fdisk -l, or with gparted
- use this name to get the UUID : sudo blkid /dev/sdax (your device's name)
Then add the entry to fstab replacing "/dev/sdax" by "UUID=[your device's UUID]".
@jahid_0903014:
... agreed :-(
@Rebel450
Just an example,
My university teacher called me a few days ago and showed me a print copy of this tutorial and asked if I was the author (my roll number is in my username).
And also he told me that he tried other methods (searching from internet) which gave him unsatisfactory results, while this method worked for every cases (it is supposed to be, as it's the basics of the basics). He asked for other advices on how to backup his ubuntu machine and some other things.
Knowing to use the terminal, being able to change things from the deepest level of something is what we call power. If you become too much reliable on GUI front-end, it won't be that much long when you find yourself in a corner and unable to do anything because you don't know how those things actually work.
"is very easy in linuxmint with the disk utility which have a nice gui explaining everyting"
Well,
not really everything... e.g. it's not telling you that it will edit
the fstab file -
and also not how to fix it after a misled Win install on a harddrive
with an already existing Linux Mint on it ...
Neither, what to do if your computer don't like to boot anymore ...
Your how2 is very detailed and therefore appreciated.
But it is not
what a "newbie" is looking for, if he wants to solve a problem
without succeed a graduation in computer science before ;-)
No offence, Jahid - but
which is the target audience of your tutorial, please...
Slightly more colour than "man fstab"