finish machine setup to test upgrade
[gnt-info] / doc / megaraid-to-md.txt
index c21270d..3535644 100644 (file)
@@ -133,6 +133,32 @@ Adapter: 0: EnclId-32 SlotId-6 state changed to JBOD.
 Exit Code: 0x00
 
 
+Let's now wipe disks which where detected as bcache:
+
+root@lib24:~# dmesg | grep register_bdev
+[    4.941396] bcache: register_bdev() registered backing device sdc
+[  496.314350] bcache: register_bdev() registered backing device sdc
+[  510.221356] bcache: register_bdev() registered backing device sdd
+
+root@lib24:~# wipefs /dev/sd[cd]
+offset               type
+----------------------------------------------------------------
+0x1018               bcache   [other]
+                     UUID:  08a9ea8e-0a25-4efd-9075-8966c0d1fb00
+
+offset               type
+----------------------------------------------------------------
+0x1018               bcache   [other]
+                     UUID:  08a9ea8e-0a25-4efd-9075-8966c0d1fb00
+
+
+If there are partition tables on disks, they should be wiped with wipefs -a /dev/drive
+
+It's probably a good idea to reboot here so that linux kernel can re-numerate disks.
+
+
+
+
 root@lib28:~# lsblk --scsi -m
 NAME HCTL       TYPE VENDOR   MODEL             REV TRAN NAME   SIZE OWNER GROUP MODE
 sda  0:0:7:0    disk ATA      INTEL SSDSC2BW24 DC32      sda  223.6G root  disk  brw-rw----
@@ -144,6 +170,9 @@ sdf  0:0:4:0    disk ATA      ST1000NM0033-9ZM GA0A      sdf  931.5G root  disk
 sdg  0:0:5:0    disk ATA      ST1000NM0033-9ZM GA0A      sdg  931.5G root  disk  brw-rw----
 sdh  0:0:6:0    disk ATA      ST1000NM0033-9ZM GA0A      sdh  931.5G root  disk  brw-rw----
 
+
+If you didn't wipe old bcache data you might get error when creating array:
+
 root@lib28:~# mdadm --create /dev/md0 --level=10 --raid-devices=7 /dev/sd{b,c,d,e,f,g,h}
 mdadm: cannot open /dev/sdb: Device or resource busy
 root@lib28:~# lsblk 
@@ -225,6 +254,7 @@ root@lib28:~# hdparm -Tt /dev/sdh /dev/sda /dev/md0
  Timing buffered disk reads: 1888 MB in  3.01 seconds = 628.05 MB/sec
 
 
+Now we need to create new backing block device for bcache:
 
 root@lib28:~# cat /proc/mdstat 
 Personalities : [raid10] [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] 
@@ -249,6 +279,12 @@ cset.uuid               4a61e966-f18d-4fab-836a-3ff027963781
 root@lib28:~# echo 4a61e966-f18d-4fab-836a-3ff027963781 > /sys/block/bcache0/bcache/attach 
 [Thu Sep 20 14:18:08 2018] bcache: bch_cached_dev_attach() Caching md127 as bcache0 on set 4a61e966-f18d-4fab-836a-3ff027963781
 
+Same as one-liner for easier copy/paste:
+
+root@lib30:/srv/gnt-info# bcache-super-show /dev/sdh3 | grep cset.uuid | awk '{ print $2 }' > /sys/block/bcache0/bcache/attach
+[Mon Sep 24 09:38:35 2018] bcache: bch_cached_dev_attach() Caching md0 as bcache0 on set b8b500d6-b933-428b-a040-5fb0b2cbef49
+
+
 
 Verify that bcache is active (values should NOT be all zeros if it's working):