'Changing the docker data directory to a non root location changes the disks name

High-level goal: I want to build the carla-simulator in a docker environment.

Low-level goal: My root file system does not have enough disk space. Therefore, I changed my docker data directory from /var/lib/docker/ to my internal HDD mounted at: /media/<username>/HDD into the folder /media/<username>/HDD/docker/ which I created prior to changing my daemon.json in /etc/docker/. I followed this guide to achieve this modification https://www.guguweb.com/2019/02/07/how-to-move-docker-data-directory-to-another-location-on-ubuntu/. This worked well until I rebooted.

My Problem: Everytime I reboot, the name of my mounted HDD is incremented. After the first reboot, the name changed from HDD to HDD1, after the second reboot from HDD1 to HDD2. This caused many problems and I am unable to relocate my docker data directory.

Removing the data-root specification from the daemon.json removed this problem, but I would like to relocate my docker data directory.

Suspected reasons: Maybe the docker deamon starts looking for the internal HDD before ubuntu mounts the drive. But I don't know what I could do to fix my problem.

Software in use:

  • Ubuntu 20.04
  • Docker 20.10.15
  • HDD Partion as Ext4


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source