On Sun, Feb 21, 2021 at 4:16 PM George R Goffe grgoffe@yahoo.com wrote:
On Sunday, February 21, 2021, 1:48:52 PM PST, Chris Murphy lists@colorremedies.com wrote:
That works for me. But you could alternatively try:
mount /dev/vdb /mnt/btrfs losetup -r /dev/loop0 /mnt/btrfs/ext2_saved/image # losetup NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC /dev/loop0 0 0 0 1 /export/home/ext2_saved/image 0 512
blkid /dev/loop0 # this command responds with nothing
That happens if there's no signature or when running the command as an unprivileged user.
# the file command responds with: # file /export/home/ext2_saved/image #/export/home/ext2_saved/image: ERROR: cannot read `/export/home/ext2_saved/image' (Input/output error)
That's not good. What do you see in dmesg at the time of this error?
What about: e2fsck -fvn /dev/loop0
If this file is somehow damaged, I'm skeptical that rolling back the conversion to ext4 will succeed. But that's not the only option...
A bit involved but it's possible to use device-mapper to create an overlay block device, i.e. keep this ext2_saved/image file as read-only and redirect writes to a sparse file, thereby making change reversible. And then use e2fsck -b to specify a backup super block for repair.
Sooo :D this guide is designed to make it easy to setup many such overlays for RAID recovery. You could either use it as-is, or deconstruct it for just the single device you have - where your device is loop0 since it's an image file you're trying to recover.
https://raid.wiki.kernel.org/index.php/Recovering_a_failed_software_RAID#Mak...