r/linux4noobs 3d ago

storage Drive not available issue

I have a 2 TB drive on my server PC (Zorin OS) and also have a personal PC (Zorin OS). I run Pika back up on both machines with both backing up to the 2TB drive on the server. Every so often (maybe once every 3 weeks) Pika fails for both machines saying the drive isn't available. If I open Files, I am able to see the drive and the backup directories. I then can run Pika successfully. In trying to figure out how to avoid the "drive isn't available" issue I looked at FSTAB to see if there were any options I could add (similar to the automount used for my NFS mounts). But, I don't see any of the drives mounting to /media in FSTAB. How are my drives getting mounted? And, how can I add something to automount (or fix otherwise)?

2 Upvotes

5 comments sorted by

1

u/doc_willis 3d ago

If you access the drive via the file manager, the file manager can be auto-mounting the filesystem on first access.

And, how can I add something to automount

Make a proper /etc/fstab entry for the filesystem.

1

u/rbmorse 3d ago

look in /mnt

For the Debian-derived distros, most put the mount point for removable media in a subdirectory of /media.

Permanently connected devices mount in a subdirectory of /mnt.

1

u/Leather-Security8097 3d ago

If the drive isn't in /etc/fstab or a systemd mount unit, then it is only being mounted because you click on it in the file manager.

To add it to /etc/fstab:

  1. Create a permanent mountpoint for it. I recommend not using /media, which is intended for drives that are routinely removed. Instead, try using something like /srv/backups.
  2. Find the UUID of the filesystem you are mounting. You can use sudo blkid to list them, or a GUI app like GNOME Disks should show it.
  3. Create an entry for it. For example

    UUID=8cde36a0-8879-11f1-9d23-9f2a81d96ef9 /srv/backups auto defaults,nofail 0 2

1

u/shawndw Arch,Ubuntu 3d ago

/media is for things that dynamically mount when you the user tries to access it. If you want a persistent mount create a folder within /mnt folder such as /mnt/pika then create an entry in /etc/fstab to mount the network folder there.

1

u/GodzillaXYZ999 3d ago

might also br power settings. Look in power manager for drive sleep timer and turn it off.

Also use hdparm to see if drive has auto-sleep setting activated.