One good reason to run RAID1 is that all data is contained on both drives of the array. RAID1 is a cheap uptime-friendly setup which is not space efficient and should not be used on current hard drives (> 1TB). That's why current systems run RAID6 ... on expensive and reliable hardware with automatic backups and disaster recovery plans in place. What follows regarding RAID1 is, in general, impossible with any other RAID level.
With that in mind...
1. Insert drive on USB dock and connect it to a computer running Linux; in this example the device appears as /dev/sdb
2. List available partitions
root@laptop:~# parted -l /dev/sdb3. Setup RAID1 device using a single drive
[...]
Model: WDC WD50 00AAKS-00YGA0 (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
4 1049kB 10.7GB 10.7GB raid
5 10.7GB 21.5GB 10.7GB raid
1 21.5GB 23.6GB 2147MB raid
3 23.6GB 24.2GB 537MB raid
2 24.2GB 500GB 476GB raid
[...]
If you know which partition was in use in the RAID array (ex: partition 2) just run
mdadm --assemble --verbose /dev/md0 /dev/sdb2Otherwise, you can let mdadm guess. If you don't have other RAID members in the system it will probably work:
root@laptop:~# mdadm --assemble --verbose /dev/md04. Check status
mdadm: looking for devices for
/dev/md0
mdadm: no RAID superblock on /dev/sdb5
mdadm: /dev/sdb4 has wrong uuid.
mdadm: /dev/sdb3 has wrong uuid.
mdadm: /dev/sdb1 has wrong uuid.
mdadm: no RAID superblock on /dev/sdb
mdadm: no RAID superblock on /dev/sda5
mdadm: no RAID superblock on /dev/sda2
mdadm: no RAID superblock on /dev/sda1
mdadm: no RAID superblock on /dev/sda
mdadm: /dev/sdb2 is identified as a member of /dev/md0, slot 0.
mdadm: added /dev/sdb2 to /dev/md0 as 0
mdadm: /dev/md0 has been started with 1 drive.
root@laptop:~# cat /proc/mdstat Personalities : [raid1] [linear]5. Mount device
md0 : active linear sdb2[0]
464779264 blocks super 1.2 0k rounding
unused devices:
mount /dev/md0 /mnt/recoverIf the mount fails and you see this in the logs
Jun 3 14:32:53 ghlaptop kernel: [16068.061347] EXT4-fs (md0): bad block size 65536try
apt-get fuseext26. Backup your data
fuseext2 -o ro -o sync_read /dev/md0 /mnt/recover
mkdir /root/raid1data
cp -R /mnt/recover /root/raid1data
References:
https://blog.sleeplessbeastie.eu/2012/05/08/how-to-mount-software-raid1-member-using-mdadm/
http://unix.stackexchange.com/questions/73536/how-can-i-mount-filesystems-with-4kb-block-sizes
Sem comentários:
Enviar um comentário