If this is a fixed drive which is there when the machine is booted, then you can add an entry for the volume to the /etc/fstab
file.
For example, on a Ubuntu VM here, I have a fstab
entry like this:
/dev/sdb1 /personal ext4 defaults 0 0
The device /dev/sdb1
(first partition of /dev/sdb
) is mounted at /personal
. The filesystem type is ext4
, all options are defaulted.
The first zero is a traditional parameter related to the dump
backup utility, indicating dump frequency. I'm not using that so I have a zero there.
The second zero is the boot-time check order. Zero means that the volume is not checked for errors on boot. The root filesystem's entry will have a 1
here, and others that are checked usually 2
. The values determines the check order. Volumes marked 1
are checked first, then those marked 2
and so on. If volumes with the same pass number are on separate drives, then they are checked in parallel.
If you omit these numbers, it isn't a syntax error. They default to zero.
Even if the drive is a removable one, you can still create a fstab
entry, but with different options:
# substitute your device name and mount point
/dev/sdb1 /personal ext4 noauto,user 0 0
The noauto
option means that the mount -a
command will not mount the drive and thus it will not be mounted at boot time. The user
option means that regular non-root users can mount this just by running mount /personal
.
With this setup, you can then add a mount command to your ~/.bash_login
file or whatever.
Thanks. A little more complicated than I had hoped (but that's not your fault). I appreciate the info. – rmp251 – 2013-04-19T01:28:36.577