Can't find my data on a btrfs partition

branrjab29

New Member
Joined
Apr 8, 2023
Messages
2
Reaction score
0
Credits
24
I recently installed openSUSE Leap 15.4 and it created a VFAT partition for boot, btrfs partition for my data and a swap partition. The directory /home has all my data as expected.

The /etc/fstab entry for /home looks like this:

LABEL=M15-HOME /home btrfs subvol=/@/home 0 0

If I take this drive and mount it on another machine as a USB drive, I have all the partitions but /home is empty.

I searched the entire btrfs partition and did not find my data.

Am I missing something about how to mount the btrfs partition?
 


Most of the systems I have that use BRTFS the partitions look like this..

UUID=e71e7fa7-3265-49b7-a08c-1937f60011d3 / btrfs subvol=root,compress=zstd:1 0 0
UUID=4176d238-9934-4ec8-aaca-10e75fa331cf /boot ext4 defaults 1 2
UUID=F6DE-831B /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=e71e7fa7-3265-49b7-a08c-1937f60011d3 /home btrfs subvol=home,compress=zstd:1 0 0
UUID=e71e7fa7-3265-49b7-a08c-1937f60011d3 /space btrfs subvol=space,compress=zstd:1 0 0
UUID=e71e7fa7-3265-49b7-a08c-1937f60011d3 /var btrfs subvol=var,compress=zstd:1 0 0
UUID=be87c305-a73b-425f-b60a-87f8abfa2a67 none swap defaults 0 0

It seems odd that it would mount based on a label, two different drives could have the same label, how would it know which is which? You can have a label, but the label shouldn't be the mount identifier.


Note that all the BRTFS paritions have the same UUID. It's really just one partition.
We can test that with fdisk...

Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors
Disk model: INTEL SSDPEKNW020T8
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2D8D43A1-51FD-44AA-8079-D5065F6995DB

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 456703 454656 222M EFI System
/dev/nvme0n1p2 456704 6748159 6291456 3G Linux filesystem
/dev/nvme0n1p3 6748160 31913983 25165824 12G Linux swap
/dev/nvme0n1p4 31913984 4000796671 3968882688 1.8T Linux filesystem

Yes, it's the same. I see my /boot/efi, and my /boot, and my swap. Everything else is one partition.

In reality, BTRFS volumes are like subvolumes. So you have to mount them like this.

 
Thanks for the responses. I didn't add a LABEL to the btrfs partitions, Leap 15.4 installation did. I think this does tell me what's going on. I didn't keep notes on everything I tried but I think that when I first plugged in the disk, there was a mount problem. I used a mount command to try to mount the partition so I wouldn't think a LABEL could be a problem, but I did get an error about not being able to mount and after some searching found a proposed solution using something like
btrfstune -u /dev/sda1
I think I got a message about it changing the UUID which seems like a bad thing. From there, the disk became unusable.
 
Having a label isn't a problem, using it as a mount identifier could be.

 

Members online


Top