I have a Ubuntu server with a 2TB HDD (/dev/sda
) and I want to configure Docker to store its data on this HDD instead of the default location.
When I run lsblk
, the output shows that the 2TB HDD is recognized as /dev/sda
, but parted -l
shows an error: “Error: /dev/sda: unrecognised disk label”.
Here’s the output of lsblk
:
loop0 7:0 0 4K 1 loop /snap/bare/5
loop1 7:1 0 74.2M 1 loop /snap/core22/1122
loop2 7:2 0 266.6M 1 loop /snap/firefox/3836
loop3 7:3 0 497M 1 loop /snap/gnome-42-2204/141
loop4 7:4 0 505.1M 1 loop /snap/gnome-42-2204/176
loop5 7:5 0 91.7M 1 loop /snap/gtk-common-themes/1535
loop6 7:6 0 12.3M 1 loop /snap/snap-store/959
loop7 7:7 0 40.4M 1 loop /snap/snapd/20671
loop8 7:8 0 38.7M 1 loop /snap/snapd/21465
loop9 7:9 0 452K 1 loop /snap/snapd-desktop-integration/83
loop10 7:10 0 74.2M 1 loop /snap/core22/1380
sda 8:0 0 1.8T 0 disk
nvme0n1 259:0 0 238.5G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
└─nvme0n1p2 259:2 0 238G 0 part /var/snap/firefox/common/host-hunspell
I’ve successfully initialized the disk using fdisk
and created a new partition (/dev/sda1
) with a GPT partition table. However, when I try to configure Docker to use this disk for storage, I’m not sure if it’s using it correctly.
Can someone provide guidance on how to properly configure Docker to use the /dev/sda1
partition mounted at /mnt/docker_volume
for storing Docker data?
Additionally, how can I verify that Docker is indeed using this directory for its data storage?