[Solved] df shows drives as /dev/dm-3 etc

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
debian1
Posts: 26
Joined: 2023-06-08 18:59

[Solved] df shows drives as /dev/dm-3 etc

#1 Post by debian1 »

When I do
df -h
It should shows the drives as /dev/mapper/disk1 /dev/mapper/disk2 etc but it is showing them as /dev/dm-1 /dev/dm-2

It only started today and the only change was the latest 12.9 install.

fidsk / lsblk shows them as disk1/disk2 etc only df is showing it weird.

Solved: Looks like its a change and nothing I can do but live with it.
Last edited by debian1 on 2025-01-27 15:15, edited 1 time in total.

User avatar
Uptorn
Posts: 454
Joined: 2022-01-22 01:07
Has thanked: 345 times
Been thanked: 122 times

Re: [Software] df shows drives as /dev/dm-3 etc

#2 Post by Uptorn »

dm-* convention indicates to me that the volumes are being mounted automatically, such as through udisks2. Is everything functional otherwise?

debian1
Posts: 26
Joined: 2023-06-08 18:59

Re: [Software] df shows drives as /dev/dm-3 etc

#3 Post by debian1 »

Yes it works fine and it is being mounted by fstab. Just weird it was fine before the update and just changed recently. I can still see exactly what it's called using lsblk / fdisk etc. Just changed for df.

User avatar
pbear
Posts: 557
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 89 times

Re: [Software] df shows drives as /dev/dm-3 etc

#4 Post by pbear »

As I recall, they're alternate ways of referring to the same thing. You're using encryption, right? FWIW, inxi also uses the dm- notation.

debian1
Posts: 26
Joined: 2023-06-08 18:59

Re: [Software] df shows drives as /dev/dm-3 etc

#5 Post by debian1 »

@pbear That is the thing until the update, it was showing it properly.

User avatar
pbear
Posts: 557
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 89 times

Re: [Software] df shows drives as /dev/dm-3 etc

#6 Post by pbear »

Checking an encrypted VM confirms my recollection. Run ls -l /dev/mapper and ls -l /dev/dm*. You'll see the former are merely symlinks to the latter. I would argue dm-0, etc. are the "real" folders. In other words, you're worrying about a non-issue. There's nothing to fix. FWIW, df reports /dev/mapper on two VMs (fully updated), so that's puzzling, but still not important.

For comparison, here's what I see with those two commands, plus a few others, in one of the VMs. For clarity, I've removed references to a couple of shared folders (which aren't in /dev/mapper or /dev/dm* anyway).

Code: Select all

pbear@fde-data:~$ ls -l /dev/dm*
brw-rw---- 1 root disk 253, 0 Jan 25 15:49 /dev/dm-0
brw-rw---- 1 root disk 253, 1 Jan 25 15:49 /dev/dm-1

pbear@fde-data:~$ ls -l /dev/mapper
total 0
crw------- 1 root root 10, 236 Jan 25 15:48 control
lrwxrwxrwx 1 root root       7 Jan 25 15:49 sda4_crypt -> ../dm-0
lrwxrwxrwx 1 root root       7 Jan 25 15:49 sda5_crypt -> ../dm-1

pbear@fde-data:~$ df -hT -x tmpfs
Filesystem             Type      Size  Used Avail Use% Mounted on
udev                   devtmpfs  2.8G     0  2.8G   0% /dev
/dev/mapper/sda4_crypt ext4       35G   13G   20G  40% /
/dev/sda3              ext4      974M  295M  613M  33% /boot
/dev/sda2              vfat      197M  5.9M  192M   3% /boot/efi
/dev/mapper/sda5_crypt ext4       24G   24K   23G   1% /data

pbear@fde-data:~$ inxi -Sp
System:
  Host: fde-data Kernel: 6.1.0-30-amd64 arch: x86_64 bits: 64
    Desktop: Cinnamon v: 5.6.8 Distro: Debian GNU/Linux 12 (bookworm)
Partition:
  ID-1: / size: 34.14 GiB used: 12.64 GiB (37.0%) fs: ext4 dev: /dev/dm-0
  ID-2: /boot size: 973.4 MiB used: 294.1 MiB (30.2%) fs: ext4
    dev: /dev/sda3
  ID-3: /boot/efi size: 196.9 MiB used: 5.8 MiB (3.0%) fs: vfat
    dev: /dev/sda2
  ID-4: /data size: 23.24 GiB used: 24 KiB (0.0%) fs: ext4 dev: /dev/dm-1
ETA: Testing a third encrypted VM for another thread, I discover df reports /dev/dm-0 for the system partition. What's different about said VM is that it was installed from a live ISO, where the other two were the Standard Installer. Can't imagine why this makes a difference, though. df is a GNU Core Utility and all three VMs are Debian 12, plain vanilla, fully updated.

debian1
Posts: 26
Joined: 2023-06-08 18:59

Re: [Software] df shows drives as /dev/dm-3 etc

#7 Post by debian1 »

I was not worried as everything worked and other commands showed the name as it used to. I was just wondering why df has now changed what it shows.

User avatar
pbear
Posts: 557
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 89 times

Re: [Software] df shows drives as /dev/dm-3 etc

#8 Post by pbear »

Come now, "properly" is a loaded word. Anyhoo, if your question has been answered, please edit the thread title.

debian1
Posts: 26
Joined: 2023-06-08 18:59

Re: [Software] df shows drives as /dev/dm-3 etc

#9 Post by debian1 »

Anyway to change it to back to how it was showing it before?

User avatar
pbear
Posts: 557
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 2 times
Been thanked: 89 times

Re: [Software] df shows drives as /dev/dm-3 etc

#10 Post by pbear »

Download the source code, edit to suit, compile as a binary, install.

This is going to be my last post in the thread. If anyone wants to take over, please feel free.

Post Reply