mdadm –examine /dev/sda

fdisk -l /dev/sda

fsck -n

losetup –find –show –read-only –offset=$((2048*512)) /dev/sda && file -s /dev/loopZAHL

photorec

Testumgebung aufbauen:
(Annahme, Raid5 bestehend aus 3 Platten auf Partition sd[a-c]6

truncate -s10G overlay-sda6
truncate -s10G overlay-sdb6
truncate -s10G overlay-sdc6
losetup -f –show — overlay-sda6
losetup -f –show — overlay-sdb6
losetup -f –show — overlay-sdc6
echo 0 1923500000 snapshot /dev/sda6 /dev/loop1 P 8 | dmsetup create sda6
echo 0 1923500000 snapshot /dev/sdb6 /dev/loop2 P 8 | dmsetup create sdb6
echo 0 1923500000 snapshot /dev/sdc6 /dev/loop3 P 8 | dmsetup create sdc6

mdadm –create /dev/md42 –metadata=1.2 –data-offset=1M –chunk=512 –level=5 –assume-clean –raid-devices 3 /dev/mapper/sda6 /dev/mapper/sdc6 /dev/mapper/sdb6

Testumgebung resetten:

mdadm –stop /dev/md42
dmsetup remove sda6
dmsetup remove sdb6
dmsetup remove sdc6
rm overlay*
losetup -d /dev/loop1
losetup -d /dev/loop2
losetup -d /dev/loop3

Categories: Blog