0

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.

4
  • Do you want the disk to be available from the time your system starts until it shuts down (like your primary disk)? Commented Nov 12, 2023 at 21:48
  • 3
    A drive should not unmount for no reason. You must first find the reason why it unmounts: check the kernel logs (dmesg -T) Commented Nov 12, 2023 at 21:59
  • It would help to have the sudo command you use to mount the disk. Then it can be determined how to make that permanent. Commented Nov 12, 2023 at 22:26
  • @user10489 I just "unlock" it with the dolphin file manager. Commented Nov 12, 2023 at 22:26

1 Answer 1

1

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 usermount option 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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.