Similar LVM snapshot on a conventional block device

Go to the question if he is not interested in history

After the unsuccessful loss of 2 disks in array 4 of RAID RAID 5, I got into some kind of voodoo to get as much data as possible.

The first disk, showing signs of weaknesses, was replaced, and during recovery (~ 80%), the second disk failed in some dead sectors.

In short, I now have two disks (2 and 4) in a consistent state. One (3) is synchronized, but with bad sectors in the middle. The latter (1) is only partially synchronized due to the rebuilding process. Disks are 1.5 Tb for the entire 4.1 Tb array.

After you tried everything read-only voodoo in configurations 234, 124 and 1234, I was able to get a significant part of the important data. (Which is only 100 Gb in total for 4.1 Tb).

Now the next step is to try rebuilding some file system (reiserfs) to see if I can get more data. Theses are destructive. And I have three working disks in different states to try.

So to the question

Is there a way to take a snapshot of any type of md block device and work on it without changing the md device?

Some moments:

  • It doesn’t matter, the performance is very slow.

  • I have 2 * 2 TB of memory on external temporary disks that can be used to “modify” a snapshot.

  • I (md) lvm. ( )

  • , ( ).

  • , , : md .

?

!

+5
2

. , - , .

tl; dr - .

, , RAID5 4 , USB-. NTFS 640- , gddrescue, 300 . ddrescue, , .

, RAID. ( , - .) , , RAID, , , NTFS, , ntfs-3g . 300 , , , . ( testdisk, scrounge-ntfs ntfsundelete, photorec.) testdisk, NTFS, , testdisk NTFS, ntfs-3g chkdsk VirtualBox, .

, .

- dm-snapshot, . /dev/failing. -, , /dev/cow. , .

 # Make it much harder to accidentally overwrite anything
 # Run on all partition sub-devices as well, if applicable
1. blockdev --setro /dev/failing

 # Create /dev/mapper/top
2. echo 0 `blockdev --getsz /dev/failing` snapshot /dev/failing /dev/cow p 4 | dmsetup create top

 # Manipulate /dev/mapper/top as you wish

 # Tear-down
3. dmsetup remove top

/dev/cow:

.

 # Create a sparse file
1. dd if=/dev/zero bs=1048576 count=0 seek=size_in_MB of=tempfile

 # Print name of next unused loop device
2. losetup -f

 # Associate the file with a loop device
3. losetup -f tempfile

 # Use as /dev/cow

 # Use the name from #2 here
4. losetup -d /dev/loopX

5. rm tempfile

. zram kernel (. ramzswap compcache!)

 # Create 4 of them - zram0-3 (you may run into a need for more than one)
1. modprobe zram num_devices=4

 # Set size
2. echo $((1048576*size_in_MB)) > /sys/block/zram0/disksize

 # Associate with a loop device (dmsetup will fail with zramX but not loopX!)
3. losetup -f
4. losetup -f /dev/zram0

 # Use as /dev/cow

 # Use the name from #3 here
5. losetup -d /dev/loopX

6. echo reset > /sys/block/zram0

- 300GB-, , ( 25 ).

- , squashfs. 4 , (un) chunkfs ( FUSE) mksquashfs . , FAT32 NTFS ntfs-3g, . , , par2, .

, , , , 8. modprobe loop max_loop = 2048 , , max_loop = 2048 . squashfs . , dmsetup . ( man dmsetup , , -r, , .)

+11

- , dd.

0

All Articles