I have a secondary internal hard drive that once in a while will unmount and require the sudo password to mount (in the Dolphin file manager). How can I make so it does not unmount even upon a restart as it means I have to re-add it as a library in Steam and in Bottles? To be clear, I am not trying to remove the password as could be fixed by this post, I am trying to make it not unmount entirely. I am completely fine with having to erase and format the drive.
1 Answer
There are a number of ways for disks to get mounted:
- Typically disks that are to be permanently mounted are added to
/etc/fstab. - Removable disks (like USB sticks) may be automatically mounted by the udisks system, probably via
udisk-daemon. - Non-removable disks can be manually mounted by several methods, including via the
usermountoption in fstab, the udisks system, or using sudo.
If you want a disk permanently mounted at boot, your best option is probably to add it to fstab.
The man page for fstab (man fstab) lists the fields in detail. In brief, the fields are (in order):
- the source of the filesystem (device, file, network resource, etc)
- the mount point which should be some appropriate empty directory you probably should create for this purpose (such as
/data1) - the filesystem type
- the options to modify behavior of the filesystem
- two numbers which are largely obsolete and frequently left as 0
If you have successfully mounted the filesystem already, you can look in /proc/mounts in linux to find out what the current mount looks like. Frequently, this can be copied to fstab with small changes. For instance, you may want to change the device name to the UUID of the partition in case the device name changes on next boot.
After you make the fstab entry, for best results, you should unmount the disk, and then try to mount the disk using the short form of mount (e.g., mount /data1) using only the mount point to make sure the fstab entry is correct. If this fails, you will need to correct (or remove or comment out) the fstab entry before next boot or your system may fail to complete booting.
dmesg -T)