Before the usual RAID is not backup comments, let me say I do have backups. However, when I defined my backup policy, two things I did not planned:
- I decided not to backup lossy music files if I have the same file lossless. Today, I realise that I don't want to go through recreating the lossy files.
- My backup strategy missed a few less used folders, the kind that you never access, but would hate to loose (e.g. my past resume, which I only use when I am looking for a job but I would be angry if I would have to start from scratch, archive from past jobs, etc).
- Create a Ubuntu bootable USB stick. I used Rufus to create a bootable USB stick with persistent storage.
- Find a PC with the required number of SATA ports greater or equal to the number of HDD in your raid 5 array.
- Disconnect all existing HDD from the PC and connect the NAS HDD.
- Boot from the USB stick and configure as required.
- Open a terminal. Note: all commands run as sudo.
Code: Select all
sudo apt install mdadm lvm2
...
Code: Select all
sudo mdadm --assemble --scan
mdadm: /dev/md/9 has been started with 4 drives (out of 25).
mdadm: /dev/md/256 assembled from 0 drives and 2 spares - not enough to start the array.
mdadm: /dev/md/1 has been started with 4 drives.
mdadm: /dev/md/13 has been started with 4 drives (out of 24).
mdadm: /dev/md/322 assembled from 0 drives and 1 spare - not enough to start the array.
mdadm: /dev/md/256 assembled from 0 drives and 2 spares - not enough to start the array.
mdadm: /dev/md/322 assembled from 0 drives and 1 spare - not enough to start the array.
Code: Select all
sudo cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md322 : inactive sdc5[3](S)
8353780 blocks super 1.0
md13 : active raid1 sdb4[0] sdc4[25] sdd4[24] sda4[1]
458880 blocks super 1.0 [24/4] [UUUU____________________]
bitmap: 1/1 pages [4KB], 65536KB chunk
md1 : active raid5 sdb3[0] sdc3[3] sdd3[2] sda3[1]
11691190848 blocks super 1.0 level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
md256 : inactive sdd2[2](S) sdc2[3](S)
1060248 blocks super 1.0
md9 : active raid1 sdb1[0] sdc1[25] sdd1[24] sda1[1]
530048 blocks super 1.0 [25/4] [UUUU_____________________]
bitmap: 1/1 pages [4KB], 65536KB chunk
unused devices: <none>
Code: Select all
sudo fdisk -l /dev/md1
Disque /dev/md1 : 10,91 TiB, 11971779428352 octets, 23382381696 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 4096 octets
taille d'E/S (minimale / optimale) : 65536 octets / 196608 octets
Code: Select all
sudo mkdir /mnt/raid
sudo mount /dev/md1 /mnt/raid
mount: /mnt/raid: type de système de fichiers « LVM2_member » inconnu.
Code: Select all
sudo vgscan
WARNING: PV /dev/md1 in VG vg1 is using an old PV header, modify the VG to update.
Found volume group "vg1" using metadata type lvm2
Code: Select all
sudo lvscan
WARNING: PV /dev/md1 in VG vg1 is using an old PV header, modify the VG to update.
ACTIVE '/dev/vg1/lv544' [<111,59 GiB] inherit
ACTIVE '/dev/vg1/lv1' [<10,78 TiB] inherit
Code: Select all
sudo mount /dev/vg1/lv1 /mnt/raid
sudo ls /mnt/raid
...
...
To retrieve data, you can use the Ubuntu Desktop file manager to copy file to another external HDD. However rsync is faster.
Code: Select all
sudo rsync -av --stats --exclude '.Qsync' --exclude '@Recycle' --exclude '.streams/' --exclude '.@__thumb/' /mnt/raid/<folder to recover> /media/ubuntu/<your external hdd>/<destination folder>