Advertisement
Guest User

Untitled

a guest
Nov 18th, 2016
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. Script started on Fr 18 Nov 2016 21:50:01 CET
  2. zoey# mkdir overlays
  3. zoey# cd overlays
  4. zoey# for i in sd{b,c1,d1}; do truncate -r /dev/$i f_$i; done
  5. zoey# ls -l
  6. insgesamt 24
  7. -rw-r--r-- 1 root root 4000787030016 Nov 18 21:52 f_sdb
  8. -rw-r--r-- 1 root root 4000785104896 Nov 18 21:52 f_sdc1
  9. -rw-r--r-- 1 root root 4000785104896 Nov 18 21:52 f_sdd1
  10. zoey# for i in sd{b,c1,d1}; do printf '%s\n' "0 $(blockdev --getsz /dev/$i) snapshot /dev/$i $(losetup -f --show f_$i) P 8" | dmsetup create o_$i; done
  11. zoey# ls -l /dev/mapper
  12. insgesamt 0
  13. crw------- 1 root root 10, 236 Nov 18 21:52 control
  14. lrwxrwxrwx 1 root root 7 Nov 18 21:52 o_sdb -> ../dm-0
  15. lrwxrwxrwx 1 root root 7 Nov 18 21:52 o_sdc1 -> ../dm-1
  16. lrwxrwxrwx 1 root root 7 Nov 18 21:52 o_sdd1 -> ../dm-2
  17. zoey# cat /proc/mdstat
  18. Personalities : [raid6] [raid5] [raid4]
  19. unused devices: <none>
  20. zoey# mdadm --assemble /dev/md0 --verbose /dev/mapper/o_sdb /dev/mapper/o_sdc1 /dev/mapper/o_sdd1
  21. mdadm: looking for devices for /dev/md0
  22. mdadm: /dev/mapper/o_sdb is identified as a member of /dev/md0, slot 0.
  23. mdadm: /dev/mapper/o_sdc1 is identified as a member of /dev/md0, slot 1.
  24. mdadm: /dev/mapper/o_sdd1 is identified as a member of /dev/md0, slot 2.
  25. mdadm: failed to add /dev/mapper/o_sdc1 to /dev/md0: Invalid argument
  26. mdadm: failed to add /dev/mapper/o_sdd1 to /dev/md0: Invalid argument
  27. mdadm: added /dev/mapper/o_sdb to /dev/md0 as 0
  28. mdadm: /dev/md0 assembled from 1 drive - need all 3 to start it (use --run to insist).
  29. zoey# mdadm --assemble /dev/md0 --verbose /dev/mapper/o_sdb /dev/mapper/o_sdc1 /dev/mapper/o_sdd1 --force
  30. mdadm: looking for devices for /dev/md0
  31. mdadm: /dev/mapper/o_sdb is identified as a member of /dev/md0, slot 0.
  32. mdadm: /dev/mapper/o_sdc1 is identified as a member of /dev/md0, slot 1.
  33. mdadm: /dev/mapper/o_sdd1 is identified as a member of /dev/md0, slot 2.
  34. mdadm: failed to add /dev/mapper/o_sdc1 to /dev/md0: Invalid argument
  35. mdadm: failed to add /dev/mapper/o_sdd1 to /dev/md0: Invalid argument
  36. mdadm: added /dev/mapper/o_sdb to /dev/md0 as 0
  37. mdadm: failed to RUN_ARRAY /dev/md0: Input/output error
  38. zoey# mdadm --create /dev/md0 --level 5 --raid-devices 3 --assume-clean /dev/mapper/o_sdb /dev/mapper/o_sdc1 /dev/mapper/o_sdd1
  39. mdadm: /dev/mapper/o_sdb appears to be part of a raid array:
  40. level=raid5 devices=3 ctime=Fri Sep 26 17:23:15 2014
  41. mdadm: /dev/mapper/o_sdc1 appears to be part of a raid array:
  42. level=raid5 devices=3 ctime=Fri Sep 26 17:23:15 2014
  43. mdadm: /dev/mapper/o_sdd1 appears to be part of a raid array:
  44. level=raid5 devices=3 ctime=Fri Sep 26 17:23:15 2014
  45. Continue creating array? y
  46. mdadm: Defaulting to version 1.2 metadata
  47. mdadm: array /dev/md0 started.
  48. zoey# ls /dev/md*
  49. /dev/md0
  50.  
  51. /dev/md:
  52. zoey# blkid /dev/md0
  53. zoey# head -c 2048 /dev/md0 |file -
  54. /dev/stdin: data
  55. zoey# mdadm --stop /dev/md0
  56. mdadm: stopped /dev/md0
  57. zoey# exit
  58.  
  59. Script done on Fr 18 Nov 2016 21:57:31 CET
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement