My situation seems to be out of sync with that page. Brother-in-law’s bad SSD originally used btrfs for 42.2, and eventually reached 15.1 in November. First I used ddrescue to clone from the bad SSD to another disk. Then I connected the other disk to a working 15.1 as sdb.
These are the last steps from there I’ve taken:
btrfs rescue zero-log /dev/sda1
Then try to mount the device normally. If it works, stop going.
What exactly is
mount normally
with btrfs?
# mount /dev/sdb2 /mnt
has apparently mounted / just fine, but /mnt/home is void, empty. It should contain what needs to be rescued. Is /home that lost, or is some further mounting step(s) required?
First, one does not say “/mnt/home is void” (at least you do not say that only). You always show what the system thinks of it, because we believe systems, not people
ls -l /mnt/home
I do not know if /home belonging to that root file system you just mounted on /mnt, is a separate file system or not. When it is, you must of course mount it (when you need so).
Malcolm’s post is complete,
If the point was missed, one of the very, very big changes in 15.1 is that by default /home is no longer mounted as its own partition, is now a BTRFS sub-volume on the same partition as root.
Somehow the email notice anyone replied here never reached me. I was so mired in various failures I only just minutes ago thought to take a look here.
# ls -l /mnt/home
total 0
# grep home /mnt/etc/fstab
UUID=5893c170-a545-4d9e-9e42-d6682b1fd9a5 /home btrfs subvol=@/home 0 0
# btrfs subvolume list /mnt | grep home
ID 262 gen 954211 top level 257 path @/home
# btrfs subvolume show /mnt/home
ERROR: Not a Btrfs subvolume: Invalid argument
# btrfs subvolume list /mnt | grep snapshots
ID 258 gen 954228 top level 257 path @/.snapshots
ID 259 gen 954240 top level 258 path @/.snapshots/1/snapshot
ID 885 gen 905333 top level 258 path @/.snapshots/74/snapshot
ID 985 gen 905333 top level 258 path @/.snapshots/77/snapshot
ID 989 gen 914097 top level 258 path @/.snapshots/78/snapshot
ID 1143 gen 914097 top level 258 path @/.snapshots/79/snapshot
ID 1146 gen 914097 top level 258 path @/.snapshots/82/snapshot
ID 1147 gen 914097 top level 258 path @/.snapshots/83/snapshot
ID 1148 gen 914097 top level 258 path @/.snapshots/84/snapshot
ID 1149 gen 914097 top level 258 path @/.snapshots/85/snapshot
ID 1150 gen 914097 top level 258 path @/.snapshots/86/snapshot
ID 1151 gen 914097 top level 258 path @/.snapshots/87/snapshot
ID 1155 gen 914097 top level 258 path @/.snapshots/88/snapshot
ID 1156 gen 914097 top level 258 path @/.snapshots/89/snapshot
ID 1157 gen 914097 top level 258 path @/.snapshots/90/snapshot
ID 1164 gen 914097 top level 258 path @/.snapshots/91/snapshot
ID 1165 gen 914097 top level 258 path @/.snapshots/92/snapshot
ID 1168 gen 914097 top level 258 path @/.snapshots/93/snapshot
ID 1232 gen 954180 top level 258 path @/.snapshots/94/snapshot
# mount -t btrfs -o subvol=home /dev/sdb2 /mnt/home
mount: /mnt/home: mount(2) system call failed: No such file or directory.
Am I missing something? Was a critical sector not successfully recovered by ddrescue?
Looks to me in your instance /home is in its own partition.
Maybe it’s an upgrade? Maybe I didn’t understand that the system was originally installed with a BTRFS root in 42.2? In that case /home should not be expected to be BTRFS, should be something else (possibly XFS).
I am sorry, but I just do not understand any of this.
The original SSD had a damaged rrot partition.
It was partitioned for Leap-42.3, then upgraded to 15.0 and 15.1
Presumably it had EFI, root, home and swap partitions (degault installation).
The damaged drive was cloned.
So the same partitions would be kept as on the original.
The old drives root partition (/dev/sdb2) was mounted at /mnt on the new drive.
Unless /dev/sdb[home] was mounted at </dev/sda[root]>/mnt/home, I would expect /mnt/home to appear as an empty directory (mount point). which is what I think you meant as “void”.
Assuming /home on the old drive was in /dev/sda3 what happens if you
# mount /dev/sdb2 /mnt
# mount /dev/sdb3 /mnt/home
> df -hT |grep -v tmpfs
I am interested in this thread because on the 15th January I updated Leap-15.1 on this laptop and was left with an unbootable system. The btrfs (no snapshots) root partition (/dev/sda3) was being mounted read-only.
I was unable to repair the filesystem so, using a usb rescue boot, I created a new partition (/dev/sda5), mounted sda3 on /mnt and sda5 on /mnt2, copied (cp -a) /mnt/ to /mnt2. chrooted to /mnt2 and used YaST to recreate /etc/fstab and the grub2-efi configuration.
I have been using the machine since, but am looking for hints to see if it is possible to repair the /dev/sda3 filesystem. I do not mean to hijack this thread and intended to start a new thread once I had time to read the btrfs documentation and do some experimentation.
With the many subvolumes existing I found it annoying to inspect their contents by individually mounting them. Thus I changed my procedures to mount toplevel subvolume: **mount -o subvolid=5 /dev/sdb2 /mnt/ **You may try and report.
# **btrfs subvolume list /mnt | grep home**
ID 262 gen 954211 top level 257 path @/home
# **mount -o subvolid=257 /dev/sdb2 /mnt/**
mount: /mnt: /dev/sdb2 already mounted on /mnt.
# **ll /mnt/@/**
ls: cannot access '/mnt/@/': No such file or directory
# **mount -o subvolid=262 /dev/sdb2 /mnt/home/**
# **ll /mnt/@/**
ls: cannot access '/mnt/@/': No such file or directory
# **ll /mnt/home/**
total 0
drwxr-xr-x 1 root root 28 Mar 11 2019 .
drwxr-xr-x 1 root root 182 Feb 5 00:29 ..
drwxr-xr-x 1 root root 876 Nov 12 2016 old-speed
drwxr-xr-x 1 1000 users 1076 Feb 4 22:43 speed
# **mc**
> highlight old-speed and speed > F5 >12433 of 71084 files copied before mc processing ceased in .local/share/Trash/, so I started over doing directory by directory from speed, getting whatever was readable. Probably less than three dozen lost among many thousands.
You’re welcome! The procedure is the same as with any other file system.
Users new to btrfs may want to note:
The top-level subvolume (with Btrfs id 5) (which one can think of as the root of the volume) can be mounted, and the full filesystem structure will be seen at the mount point; alternatively any other subvolume can be mounted (with the mount options subvol or subvolid, for example subvol=subvol_a) and only anything below that subvolume (in the above example the subvolume subvol_b, its contents, and file file_4) will be visible at the mount point.
Subvolumes can be nested and each subvolume (except the top-level subvolume) has a parent subvolume. Mounting a subvolume also makes any of its nested child subvolumes available at their respective location relative to the mount-point.
A Btrfs filesystem has a default subvolume
, which is initially set to be the top-level subvolume and which is mounted if no subvol or subvolid option is specified. - Changing the default subvolume with btrfs subvolume default will make the top level of the filesystem inaccessible, except by use of the subvol=/ or subvolid=5 mount options.