Dit zijn aantekeningen/dumps van het proces tijdens aanmaken van software RAID met de Linksys NSLU2
$ fdisk /dev/sda
The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 366 2939863+ 83 Linux
/dev/sda2 367 429 506047+ 82 Linux swap
/dev/sda3 430 121601 973314090 83 Linux
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): fd
Changed system type of partition 2 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): fd
Changed system type of partition 3 to fd (Linux raid autodetect)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table
$ fdisk /dev/sdb
The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): fd
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): fd
Changed system type of partition 3 to fd (Linux raid autodetect)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table
$ fdisk /dev/sdb
The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 366 2939863+ fd Linux raid autodetect
/dev/sdb2 367 429 506047+ fd Linux raid autodetect
/dev/sdb3 430 121601 973314090 fd Linux raid autodetect
Command (m for help):
$ mdadm --create --auto=yes /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
$ mdadm --create --auto=yes /dev/md2 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
$ mkfs.ext3 /dev/md1
$ mkswap /dev/md2
$ swapon /dev/md2
$ mdadm --create --auto=yes /dev/md3 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
$ mkfs.ext3 /dev/md3
$ echo 'DEVICE /dev/sd*[0-9]' > /etc/mdadm.conf
$ mdadm --detail --scan >> /etc/mdadm.conf
$ cat /etc/mdadm.conf
DEVICE /dev/sd*[0-9]
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=163677ae:dcf28856:532a250d:3e2e2add
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=465cfdbf:e4c3076b:87637e08:a1f8041e
ARRAY /dev/md3 level=raid1 num-devices=2 UUID=4ce7633f:78319b4e:234fe006:fc8cfbec
Om het proces te versnellen, een disk van de RAID in fail zetten, zodat het syncen stopt:
$ mdadm /dev/md3 --fail /dev/sda3
sed s/' UUID="$uuid" '/' "$device" '/ </sbin/turnup >/tmp/turnup-patched
sh /tmp/turnup-patched disk -i /dev/md1 -t ext3
$ reboot
Check swapspace met:
$ free
Check met het volgende commando de status van de /dev/md3 RAID partitie:
$ mdadm --detail /dev/md3
Voeg de disk weer toe om het syncen te starten:
$ mdadm /dev/md3 --add /dev/sda3
/dev/md3 /opt ext3 defaults 0 0
Ook moet in fstab voor de ‘/’-directory noatime als optie gezet worden, dit om de harddisk eerder in spindown te laten gaan:
/dev/md1 / ext3 defaults,noatime 1 1