this post was submitted on 14 Jun 2025
23 points (89.7% liked)

Selfhosted

46653 readers
491 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

So I recently moved most of my docker storage to a second hard drive, called "storage." After a system restart, docker is creating a folder called "storage," forcing the physical drive to be renamed "storage1." How do I prevent this from happening?

I am using Xubuntu.


Edit: As suggested, it was indeed my system spinning up Docker before mounting the internal disk. The solution (should work on most Unix-like systems) was to manually add a line to /etc/fstab as follows: First get the UUID for the problem drive

~$ sudo blkid -s UUID

The output will show your drives and the UUID of each. Then edit the following file:

~$ sudo mousepad /etc/fstab #{or use your choice of editor, i.e. nano}

Add the following line:

/dev/disk/by-uuid/{UUID number copied from blkid output} /destination/of/your/drive ext4 defaults 0 0

Of course replace {UUID number copied from blkid output} and /destination/of/your/drive and set defaults & parameters as needed. These worked for me.

Restart the system and the drive should be forced to mount before docker starts. This seems to be a known issue with certain docker setups.

you are viewing a single comment's thread
view the rest of the comments
[–] bus_factor@lemmy.world 12 points 1 day ago* (last edited 1 day ago) (2 children)

It looks like you're relying on media automounting to access the drive, but this is happening too late for Docker.

I would suggest creating the empty folder and explicitly adding the mount to /etc/fstab instead. This should mount early enough, and even if it doesn't it needs an empty folder for the mount point anyway.

Edit: Make sure you reference the partition by UUID, because the device name of USB devices sometimes change after a reboot.

[–] gedaliyah@lemmy.world 1 points 9 hours ago

Thanks - this was the solution. I've updated the post to reflect the solution I used.

Agreed. Needs to be a required mount in fstab. System won't even start then if the mount fails, docker always has access