Guest User

unable to "shrink" (via --grow) mdadm RAID

a guest
Sep 26th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. I have a 6xHDD RAID6, 2TB. (~2years old) Today I bought 2 new drives, wanted to expand my array.
  2.  
  3. fermulator@fermmy-server:~$ sudo mdadm --add /dev/md2000 /dev/sdq1
  4. mdadm: /dev/sdq1 not large enough to join array
  5.  
  6. OH ... lovely ... the new drives are a tiny bit so much smaller.
  7.  
  8. Existing drives are:
  9. fermulator@fermmy-server:~$ sudo fdisk -l /dev/sdk
  10.  
  11. Disk /dev/sdk: 2000.4 GB, 2000398934016 bytes
  12. 141 heads, 2 sectors/track, 13854713 cylinders
  13. Units = cylinders of 282 * 512 = 144384 bytes
  14. Sector size (logical/physical): 512 bytes / 512 bytes
  15. I/O size (minimum/optimal): 512 bytes / 512 bytes
  16. Disk identifier: 0xb277c3e5
  17.  
  18. Device Boot Start End Blocks Id System
  19. /dev/sdk1 8 13854714 1953513560 fd Linux raid autodetect
  20.  
  21. New drives are:
  22. fermulator@fermmy-server:~$ sudo fdisk -l /dev/sdq
  23.  
  24. Disk /dev/sdq: 2000.4 GB, 2000398934016 bytes
  25. 255 heads, 63 sectors/track, 243201 cylinders
  26. Units = cylinders of 16065 * 512 = 8225280 bytes
  27. Sector size (logical/physical): 512 bytes / 512 bytes
  28. I/O size (minimum/optimal): 512 bytes / 512 bytes
  29. Disk identifier: 0x1d99a245
  30.  
  31. Device Boot Start End Blocks Id System
  32. /dev/sdq1 1 243201 1953512001 fd Linux raid autodetect
  33.  
  34.  
  35. fermulator@fermmy-server:~$ sudo mdadm -D /dev/md2000
  36. /dev/md2000:
  37. Version : 01.01
  38. Creation Time : Fri Apr 22 01:12:07 2011
  39. Raid Level : raid6
  40. Array Size : 7814053632 (7452.06 GiB 8001.59 GB)
  41. Used Dev Size : 3907026816 (3726.03 GiB 4000.80 GB)
  42. Raid Devices : 6
  43. Total Devices : 6
  44. Preferred Minor : 2000
  45. Persistence : Superblock is persistent
  46.  
  47. Update Time : Wed Sep 25 00:40:21 2013
  48. State : clean
  49. Active Devices : 6
  50. Working Devices : 6
  51. Failed Devices : 0
  52. Spare Devices : 0
  53.  
  54. Chunk Size : 64K
  55.  
  56. Name : fermmy-server:2000 (local to host fermmy-server)
  57. UUID : 15d2158f:5cf74d95:fd7f5607:0e447573
  58. Events : 12794
  59.  
  60. Number Major Minor RaidDevice State
  61. 0 8 161 0 active sync /dev/sdk1
  62. 1 8 177 1 active sync /dev/sdl1
  63. 2 8 193 2 active sync /dev/sdm1
  64. 3 8 209 3 active sync /dev/sdn1
  65. 5 8 145 4 active sync /dev/sdj1
  66. 4 8 129 5 active sync /dev/sdi1
  67.  
  68. BEFORE
  69. AFTER
  70. Filesystem Size Used Avail Use% Mounted on
  71. /dev/md2000 7.2T 6.1T 738G 90% /media/arrays/md2000
  72.  
  73. Filesystem 1K-blocks Used Available Use% Mounted on
  74. /dev/md2000 7691438116 6527401064 773334372 90% /media/arrays/md2000
  75. Filesystem Size Used Avail Use% Mounted on
  76. /dev/md2000 7.2T 6.1T 737G 90% /media/arrays/md2000
  77.  
  78. Filesystem 1K-blocks Used Available Use% Mounted on
  79. /dev/md2000 7689826444 6527401064 771804620 90% /media/arrays/md2000
  80.  
  81. (shrunk ext4 filesystem by 1611672 1K-blocks = ~1,650,352,128bytes = 1.6Gb! -- should be plenty right?)
  82.  
  83. Now what?....
  84.  
  85. Now I have to shrink the array ...
  86. http://webapp5.rrz.uni-hamburg.de/SuSe-Dokumentation/manual/sles-manuals_en/manual/raidresize.html#resizedecrraid
  87.  
  88. but it has no effect
  89.  
  90. fermulator@fermmy-server:~$ sudo mdadm -D /dev/md2000 | grep -e "Array Size" -e "Device Size"
  91. Array Size : 7814053632 (7452.06 GiB 8001.59 GB)
  92.  
  93. So ... if that value is in kbytes, I need to remove ~1611672 from it:
  94. 7814053632-1611672=7812441960
  95. --> 7450.52GiB
  96.  
  97. no luck though...
  98.  
  99. fermulator@fermmy-server:~$ sudo mdadm --grow /dev/md2000 -z 7812441960
  100. fermulator@fermmy-server:~$ sudo mdadm -D /dev/md2000 | grep -e "Array Size" -e "Device Size"
  101. Array Size : 7814053632 (7452.06 GiB 8001.59 GB)
  102.  
  103. md2000 : active raid6 sdk1[0] sdm1[2] sdn1[3] sdj1[5] sdi1[4] sdl1[1]
  104. 7814053632 blocks super 1.1 level 6, 64k chunk, algorithm 2 [6/6] [UUUUUU]
  105.  
  106. ----
  107. fermulator@fermmy-server:~$ cat /etc/issue
  108. Ubuntu 10.04.4 LTS \n \l
  109.  
  110. fermulator@fermmy-server:~$ uname -a
  111. Linux fermmy-server 2.6.32-49-generic-pae #111-Ubuntu SMP Thu Jun 20 21:44:04 UTC 2013 i686 GNU/Linux
  112. fermulator@fermmy-server:~$ mdadm --version
  113. mdadm - v2.6.7.1 - 15th October 2008
Advertisement
Add Comment
Please, Sign In to add comment