I've a partition on /dev/sda2 of 279 GB Ext4 filesystem, but I'm not able to auto mount it on login.
I've added the partition entry /dev/sda /home ext4 defaults 0 0
in /etc/fstabt
still it does not auto mount.
I've even tried to edit the mount options from disks (please see the below screenshot), yet no results.
The udisks command works well but the problem is that, it asks a admin password for standard user.
So my question is how do I auto mount this partition or at least grant read write permission to standard user so that they can mount this partition using udisks command.
Thanks to dschinn1001 I was able to automount my partition by editing the entry in fstab.
First I fount the UUID using sudo blkid
Then edit the fstab file using sudo /etc/fstab
Add the entry in the following format
[Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]
Device will be your UUID
Mount Point will be the location where you want to mount your partition
File System Type will be displayed when you run blkid command
Options Add the options you need. See options in Fstab for more details.
Dump This value will be zero most cases. See Fstab for more details.
Pass This value will be zero most cases. See Fstab for more details.
So finally this is how my entry looks like.
UUID=fe9ab5ba-35ed-49c5-b1d3-9bfc02060867 /media/mount ext4 auto,user,rw,exec 0 0
Save the file and restart your PC.
In the options I've mentioned
auto which means auto mount
user which means grant standard users to mount partition
rw read write permission
exec Permit the execution of binaries from the filesystem
partition entry is not quite correct ( /home is in /dev/sda2 ? ) :
you wrote:
( if you write like that then you should replace
/dev/sda
with:you can determine UUID-number with command:
sudo blkid
)but it could look like this too ( in older Linux-Versions):
or like this:
more is explained here :
https://help.ubuntu.com/community/AutomaticallyMountPartitions
https://help.ubuntu.com/community/Fstab
https://help.ubuntu.com/community/UsingUUID
By
/etc/fstabt
I assume you meant/etc/fstab
. The problem with your mount spec is probably that you want to mount a partition, where /dev/sda refers to the entire disk.(as an example). List available partitions using
sudo fdisk -l
. As dschinn1001 mentions, a UUID is more desirable than a disk/partition number. The corresponding entry in my own fstab runs:Worth mentioning, /home is where your user accounts live. You have been running apparently with /home sourced from somewhere else. Once you get /home mounting properly from a new partition at boot time, the old home directory will be buried.
For everyone who want to auto mount different partitions (different UUID's) but all partitions with a specific label use this (example for exFAT file system).
/backup
./dev/sda1
in this example. In my case you can see, that/dev/sda1
has noLABEL
andTYPE="exfat"
(file system).Optional format your device if it is not formatted as exFAT
ATTENTION, all data at this partition will be removed after calling this command!
Set a fitting label
My label is just called
backup
. Don't swap this labelbackup
with the previous created mounting point/backup
./dev/sda1
hasLABEL="backup"
andTYPE="exfat"
(file system).Prepare system for auto mount
Open
/etc/fstab
with nano editor.Add this line to the end of file.
Save the file.
Just to add to these excellent answers here. Instead of rebooting you can test your fstab with a simple command to make sure it is correct.
Granted if you are created a label and adding it via the Disks app this isn't require because it will undoubtedly be correct, but if you are on a server and editing fstab it is a helpful command.