Guest User

Untitled

a guest
Feb 15th, 2011
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.31 KB | None | 0 0
  1. wd@wd-virtual-machine:~$ sudo su
  2. [sudo] password for wd:
  3. root@wd-virtual-machine:/home/wd# cd ~
  4. root@wd-virtual-machine:~# sfdisk -l
  5.  
  6. Disk /dev/sda: 1044 cylinders, 255 heads, 63 sectors/track
  7. Warning: extended partition does not start at a cylinder boundary.
  8. DOS and Linux will interpret the contents differently.
  9. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
  10.  
  11. Device Boot Start End #cyls #blocks Id System
  12. /dev/sda1 * 0+ 993- 994- 7977984 83 Linux
  13. /dev/sda2 993+ 1044- 51- 407553 5 Extended
  14. /dev/sda3 0 - 0 0 0 Empty
  15. /dev/sda4 0 - 0 0 0 Empty
  16. /dev/sda5 993+ 1044- 51- 407552 82 Linux swap / Solaris
  17.  
  18. Disk /dev/sdb: 243201 cylinders, 255 heads, 63 sectors/track
  19. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
  20.  
  21. Device Boot Start End #cyls #blocks Id System
  22. /dev/sdb1 4 247 244 1959930 fd Linux raid autodetect
  23. /dev/sdb2 248 279 32 257040 fd Linux raid autodetect
  24. /dev/sdb3 280 402 123 987997+ fd Linux raid autodetect
  25. /dev/sdb4 403 121600 121198 973522935 fd Linux raid autodetect
  26.  
  27. Disk /dev/md_d1: 64240 cylinders, 2 heads, 4 sectors/track
  28.  
  29. sfdisk: ERROR: sector 0 does not have an msdos signature
  30. /dev/md_d1: unrecognized partition table type
  31. No partitions found
  32.  
  33. Disk /dev/md_d3: 246976 cylinders, 2 heads, 4 sectors/track
  34.  
  35. sfdisk: ERROR: sector 0 does not have an msdos signature
  36. /dev/md_d3: unrecognized partition table type
  37. No partitions found
  38.  
  39. Disk /dev/md_d0: 489952 cylinders, 2 heads, 4 sectors/track
  40.  
  41. sfdisk: ERROR: sector 0 does not have an msdos signature
  42. /dev/md_d0: unrecognized partition table type
  43. No partitions found
  44. root@wd-virtual-machine:~# wget http://download.wdc.com/nas/wdhxnc-01.02.06_010411.img -O ./fw.img
  45. --2011-02-15 20:59:16-- http://download.wdc.com/nas/wdhxnc-01.02.06_010411.img
  46. Resolving download.wdc.com... 89.114.195.49
  47. Connecting to download.wdc.com|89.114.195.49|:80... connected.
  48. HTTP request sent, awaiting response... 200 OK
  49. Length: 50741917 (48M) [text/plain]
  50. Saving to: `./fw.img'
  51.  
  52. 100%[======================================>] 50,741,917 3.68M/s in 15s
  53.  
  54. 2011-02-15 20:59:31 (3.25 MB/s) - `./fw.img' saved [50741917/50741917]
  55.  
  56. root@wd-virtual-machine:~# # "decode" the firmware image and remove unnecessary files
  57. root@wd-virtual-machine:~# # see /proto/SxM_webui/admin/inc/wixHooks.class
  58. root@wd-virtual-machine:~# dd skip=0 count=1 bs=5120 if=./fw.img of=./tmp_img1
  59. 1+0 records in
  60. 1+0 records out
  61. 5120 bytes (5.1 kB) copied, 0.000302557 s, 16.9 MB/s
  62. root@wd-virtual-machine:~# dd skip=15 count=1 bs=5120 if=./fw.img of=./tmp_img2
  63. 1+0 records in
  64. 1+0 records out
  65. 5120 bytes (5.1 kB) copied, 0.000315965 s, 16.2 MB/s
  66. root@wd-virtual-machine:~# cp ./fw.img ./fw_img.orig
  67. root@wd-virtual-machine:~# dd seek=0 count=1 bs=5120 if=./tmp_img2 of=./fw.img
  68. 1+0 records in
  69. 1+0 records out
  70. 5120 bytes (5.1 kB) copied, 0.00302189 s, 1.7 MB/s
  71. root@wd-virtual-machine:~# dd skip=1 seek=1 bs=5120 if=./fw_img.orig of=./fw.img
  72. 9909+1 records in
  73. 9909+1 records out
  74. 50736797 bytes (51 MB) copied, 0.929665 s, 54.6 MB/s
  75. root@wd-virtual-machine:~# cp ./fw.img ./fw_img.orig
  76. root@wd-virtual-machine:~# dd seek=15 count=1 bs=5120 if=./tmp_img1 of=./fw.img 1+0 records in
  77. 1+0 records out
  78. 5120 bytes (5.1 kB) copied, 0.000312721 s, 16.4 MB/s
  79. root@wd-virtual-machine:~# dd skip=16 seek=16 bs=5120 if=./fw_img.orig of=./fw.img
  80. 9894+1 records in
  81. 9894+1 records out
  82. 50659997 bytes (51 MB) copied, 0.739531 s, 68.5 MB/s
  83. root@wd-virtual-machine:~# rm ./tmp_img1
  84. root@wd-virtual-machine:~# rm ./tmp_img2
  85. root@wd-virtual-machine:~# rm ./fw_img.orig
  86. root@wd-virtual-machine:~#
  87. root@wd-virtual-machine:~# # extract gzipped image .tar.gz
  88. root@wd-virtual-machine:~# tar zxf ./fw.img
  89. root@wd-virtual-machine:~#
  90. root@wd-virtual-machine:~# # check if md5sum matches
  91. root@wd-virtual-machine:~# md5sum -c upgrd-pkg-1nc.wdg.md5
  92. upgrd-pkg-1nc.wdg: OK
  93. root@wd-virtual-machine:~#
  94. root@wd-virtual-machine:~# # unpack firmware to /fw
  95. root@wd-virtual-machine:~# mkdir ./fw
  96. mkdir: cannot create directory `./fw': File exists
  97. root@wd-virtual-machine:~# SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ {print NR +1; exit 0 }' ./upgrd-pkg-1nc.wdg`
  98. root@wd-virtual-machine:~# tail -n+${SKIP} ./upgrd-pkg-1nc.wdg | gunzip | /bin/tar xm -C ./fw
  99. root@wd-virtual-machine:~#
  100. root@wd-virtual-machine:~# # check md5sums
  101. root@wd-virtual-machine:~# cd ./fw
  102. root@wd-virtual-machine:~/fw# md5sum -c md5sum.lst
  103. 1stMBR: OK
  104. 2ndMBR: OK
  105. default_env: OK
  106. packing.lst: OK
  107. reserve.list: OK
  108. reserve.sh: OK
  109. rootfs.arm.ext2: OK
  110. setmac.sh: OK
  111. stage1.wrapped: OK
  112. u-boot.wrapped: OK
  113. uImage: OK
  114. uImage.1: OK
  115. upgrade1.sh: OK
  116. upgrade1-xdelta.sh: OK
  117. upgrade2.sh: OK
  118. uUpgradeRootfs: OK
  119. root@wd-virtual-machine:~/fw# cd ..
  120. root@wd-virtual-machine:~#
  121. root@wd-virtual-machine:~#
  122. root@wd-virtual-machine:~#
  123. root@wd-virtual-machine:~#
  124. root@wd-virtual-machine:~#
  125. root@wd-virtual-machine:~#
  126. root@wd-virtual-machine:~#
  127. root@wd-virtual-machine:~#
  128. root@wd-virtual-machine:~#
  129. root@wd-virtual-machine:~#
  130. root@wd-virtual-machine:~#
  131. root@wd-virtual-machine:~#
  132. root@wd-virtual-machine:~#
  133. root@wd-virtual-machine:~# # download 945 extra Bytes with the MBR, the stage1 and the MAC-address (kernel bootcmd)
  134. root@wd-virtual-machine:~# wget http://mybookworld.wikidot.com/local--files/install-clean-hdd-in-white-light-my-book-world-edition/mbr_mac.tar.gz
  135. --2011-02-15 21:05:10-- http://mybookworld.wikidot.com/local--files/install-clean-hdd-in-white-light-my-book-world-edition/mbr_mac.tar.gz
  136. Resolving mybookworld.wikidot.com... 74.86.234.146
  137. Connecting to mybookworld.wikidot.com|74.86.234.146|:80... connected.
  138. HTTP request sent, awaiting response... 302 Found
  139. Location: http://mybookworld.wdfiles.com/local--files/install-clean-hdd-in-white-light-my-book-world-edition/mbr_mac.tar.gz [following]
  140. --2011-02-15 21:05:10-- http://mybookworld.wdfiles.com/local--files/install-clean-hdd-in-white-light-my-book-world-edition/mbr_mac.tar.gz
  141. Resolving mybookworld.wdfiles.com... 67.228.37.26
  142. Connecting to mybookworld.wdfiles.com|67.228.37.26|:80... connected.
  143. HTTP request sent, awaiting response... 200 OK
  144. Length: 945 [application/x-gzip]
  145. Saving to: `mbr_mac.tar.gz.3'
  146.  
  147. 100%[======================================>] 945 --.-K/s in 0s
  148.  
  149. 2011-02-15 21:05:11 (41.6 MB/s) - `mbr_mac.tar.gz.3' saved [945/945]
  150.  
  151. root@wd-virtual-machine:~# tar -xzf ./mbr_mac.tar.gz -C ./fw
  152. root@wd-virtual-machine:~#
  153. root@wd-virtual-machine:~# #clear boot partition
  154. root@wd-virtual-machine:~# dd if=/dev/zero of=/dev/sdb bs=512 count=64260
  155. 64260+0 records in
  156. 64260+0 records out
  157. 32901120 bytes (33 MB) copied, 64.7133 s, 508 kB/s
  158. root@wd-virtual-machine:~#
  159. root@wd-virtual-machine:~# # for infos about the DISK SECTOR OFFSETS see ./fw/upgrade1.sh
  160. root@wd-virtual-machine:~#
  161. root@wd-virtual-machine:~# # write MBR with start address of stage1
  162. root@wd-virtual-machine:~# dd if=./fw/mbr of=/dev/sdb bs=512 seek=0
  163. 1+0 records in
  164. 1+0 records out
  165. 512 bytes (512 B) copied, 0.000136299 s, 3.8 MB/s
  166. root@wd-virtual-machine:~#
  167. root@wd-virtual-machine:~# # main stage-1 image
  168. root@wd-virtual-machine:~# dd if=./fw/stage1 of=/dev/sdb bs=512 seek=1
  169. 1+0 records in
  170. 1+0 records out
  171. 512 bytes (512 B) copied, 0.000196361 s, 2.6 MB/s
  172. root@wd-virtual-machine:~#
  173. root@wd-virtual-machine:~# # main u-boot image
  174. root@wd-virtual-machine:~# dd if=./fw/u-boot.wrapped of=/dev/sdb bs=512 seek=3
  175. 216+1 records in
  176. 216+1 records out
  177. 110884 bytes (111 kB) copied, 0.00486955 s, 22.8 MB/s
  178. root@wd-virtual-machine:~#
  179. root@wd-virtual-machine:~# # main MAC image
  180. root@wd-virtual-machine:~# dd if=./fw/mac of=/dev/sdb bs=512 seek=239
  181. 1+1 records in
  182. 1+1 records out
  183. 768 bytes (768 B) copied, 0.00212463 s, 361 kB/s
  184. root@wd-virtual-machine:~#
  185. root@wd-virtual-machine:~# # main kernel image
  186. root@wd-virtual-machine:~# dd if=./fw/uImage of=/dev/sdb bs=512 seek=300
  187. 3112+1 records in
  188. 3112+1 records out
  189. 1593552 bytes (1.6 MB) copied, 0.0949254 s, 16.8 MB/s
  190. root@wd-virtual-machine:~#
  191. root@wd-virtual-machine:~# # main upgrade rootfs
  192. root@wd-virtual-machine:~# dd if=./fw/uUpgradeRootfs of=/dev/sdb bs=512 seek=6000
  193. 482+1 records in
  194. 482+1 records out
  195. 246997 bytes (247 kB) copied, 0.10947 s, 2.3 MB/s
  196. root@wd-virtual-machine:~#
  197. root@wd-virtual-machine:~# # main upgrade kernel
  198. root@wd-virtual-machine:~# dd if=./fw/uImage.1 of=/dev/sdb bs=512 seek=6512
  199. 1851+1 records in
  200. 1851+1 records out
  201. 947976 bytes (948 kB) copied, 0.0343349 s, 27.6 MB/s
  202. root@wd-virtual-machine:~#
  203. root@wd-virtual-machine:~# # backup stage-1 image
  204. root@wd-virtual-machine:~# dd if=./fw/stage1 of=/dev/sdb bs=512 seek=10608
  205. 1+0 records in
  206. 1+0 records out
  207. 512 bytes (512 B) copied, 0.0193242 s, 26.5 kB/s
  208. root@wd-virtual-machine:~#
  209. root@wd-virtual-machine:~# # backup u-boot image
  210. root@wd-virtual-machine:~# dd if=./fw/u-boot.wrapped of=/dev/sdb bs=512 seek=10610
  211. 216+1 records in
  212. 216+1 records out
  213. 110884 bytes (111 kB) copied, 0.0028217 s, 39.3 MB/s
  214. root@wd-virtual-machine:~#
  215. root@wd-virtual-machine:~# # backup MAC image
  216. root@wd-virtual-machine:~# dd if=./fw/mac of=/dev/sdb bs=512 seek=10846
  217. 1+1 records in
  218. 1+1 records out
  219. 768 bytes (768 B) copied, 0.0471945 s, 16.3 kB/s
  220. root@wd-virtual-machine:~#
  221. root@wd-virtual-machine:~# # backup kernel image
  222. root@wd-virtual-machine:~# dd if=./fw/uImage of=/dev/sdb bs=512 seek=10862
  223. 3112+1 records in
  224. 3112+1 records out
  225. 1593552 bytes (1.6 MB) copied, 0.197082 s, 8.1 MB/s
  226. root@wd-virtual-machine:~#
  227. root@wd-virtual-machine:~# # remove UPGRADE_FLAG
  228. root@wd-virtual-machine:~# echo -ne '\x00\x00\x30' | dd of=/dev/sdb seek=255
  229. 0+1 records in
  230. 0+1 records out
  231. 3 bytes (3 B) copied, 0.000184456 s, 16.3 kB/s
  232. root@wd-virtual-machine:~#
  233. root@wd-virtual-machine:~# sync
  234. root@wd-virtual-machine:~#
  235. root@wd-virtual-machine:~# cat /proc/mdstat
  236. Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
  237. md_d0 : active raid1 sdb1[0]
  238. 1959808 blocks [2/1] [U_]
  239.  
  240. md_d3 : active raid1 sdb3[0]
  241. 987904 blocks [2/1] [U_]
  242.  
  243. md_d1 : active raid1 sdb2[0]
  244. 256960 blocks [2/1] [U_]
  245.  
  246. unused devices: <none>
  247. root@wd-virtual-machine:~#
  248. root@wd-virtual-machine:~# mdadm --stop /dev/md_d0
  249. mdadm: stopped /dev/md_d0
  250. root@wd-virtual-machine:~# mdadm --stop /dev/md_d1
  251. mdadm: stopped /dev/md_d1
  252. root@wd-virtual-machine:~# mdadm --stop /dev/md_d3
  253. mdadm: stopped /dev/md_d3
  254. root@wd-virtual-machine:~# mdadm --zero-superblock /dev/sdb1
  255. root@wd-virtual-machine:~# mdadm --zero-superblock /dev/sdb2
  256. root@wd-virtual-machine:~# mdadm --zero-superblock /dev/sdb3
  257. root@wd-virtual-machine:~#
  258. root@wd-virtual-machine:~# dd if=/dev/zero of=/dev/sdb1 bs=512 count=1
  259. 1+0 records in
  260. 1+0 records out
  261. 512 bytes (512 B) copied, 0.0200727 s, 25.5 kB/s
  262. root@wd-virtual-machine:~# dd if=/dev/zero of=/dev/sdb2 bs=512 count=1
  263. 1+0 records in
  264. 1+0 records out
  265. 512 bytes (512 B) copied, 0.105417 s, 4.9 kB/s
  266. root@wd-virtual-machine:~# dd if=/dev/zero of=/dev/sdb3 bs=512 count=1
  267. 1+0 records in
  268. 1+0 records out
  269. 512 bytes (512 B) copied, 0.194267 s, 2.6 kB/s
  270. root@wd-virtual-machine:~# #clear 4. partition (/Datavolume) !!!!!!!!!!!!!!!!!!!!! Do YOU UNDERSTAND IT??
  271. root@wd-virtual-machine:~# dd if=/dev/zero of=/dev/sdb4 bs=512 count=1
  272. 1+0 records in
  273. 1+0 records out
  274. 512 bytes (512 B) copied, 0.0139838 s, 36.6 kB/s
  275. root@wd-virtual-machine:~# mdadm --zero-superblock /dev/sdb4
  276. mdadm: Unrecognised md component device - /dev/sdb4
  277. root@wd-virtual-machine:~# # make the raid partitions (md0 md1 md3)
  278. root@wd-virtual-machine:~# # echo y for "yes" !
  279. root@wd-virtual-machine:~# echo "y" | mdadm --create /dev/md0 -l 1 -n 2 /dev/sdb1 missing
  280. mdadm: /dev/sdb1 appears to contain an ext2fs file system
  281. size=1959808K mtime=Mon Feb 14 00:11:47 2011
  282. Continue creating array? mdadm: array /dev/md0 started.
  283. root@wd-virtual-machine:~# echo "y" | mdadm --create /dev/md1 -l 1 -n 2 /dev/sdb2 missing
  284. mdadm: array /dev/md1 started.
  285. root@wd-virtual-machine:~# echo "y" | mdadm --create /dev/md3 -l 1 -n 2 /dev/sdb3 missing
  286. mdadm: /dev/sdb3 appears to contain an ext2fs file system
  287. size=987904K mtime=Mon Feb 14 00:11:48 2011
  288. Continue creating array? mdadm: array /dev/md3 started.
  289. root@wd-virtual-machine:~#
  290. root@wd-virtual-machine:~# # format the raid partitions
  291. root@wd-virtual-machine:~# mkfs.ext3 /dev/md0
  292. mke2fs 1.41.12 (17-May-2010)
  293. Filesystem label=
  294. OS type: Linux
  295. Block size=4096 (log=2)
  296. Fragment size=4096 (log=2)
  297. Stride=0 blocks, Stripe width=0 blocks
  298. 122640 inodes, 489952 blocks
  299. 24497 blocks (5.00%) reserved for the super user
  300. First data block=0
  301. Maximum filesystem blocks=503316480
  302. 15 block groups
  303. 32768 blocks per group, 32768 fragments per group
  304. 8176 inodes per group
  305. Superblock backups stored on blocks:
  306. 32768, 98304, 163840, 229376, 294912
  307.  
  308. Writing inode tables: done
  309. Creating journal (8192 blocks): done
  310. Writing superblocks and filesystem accounting information: done
  311.  
  312. This filesystem will be automatically checked every 30 mounts or
  313. 180 days, whichever comes first. Use tune2fs -c or -i to override.
  314. You have new mail in /var/mail/root
  315. root@wd-virtual-machine:~# mkfs.ext3 /dev/md3
  316. mke2fs 1.41.12 (17-May-2010)
  317. Filesystem label=
  318. OS type: Linux
  319. Block size=4096 (log=2)
  320. Fragment size=4096 (log=2)
  321. Stride=0 blocks, Stripe width=0 blocks
  322. 61824 inodes, 246976 blocks
  323. 12348 blocks (5.00%) reserved for the super user
  324. First data block=0
  325. Maximum filesystem blocks=255852544
  326. 8 block groups
  327. 32768 blocks per group, 32768 fragments per group
  328. 7728 inodes per group
  329. Superblock backups stored on blocks:
  330. 32768, 98304, 163840, 229376
  331.  
  332. Writing inode tables: done
  333. Creating journal (4096 blocks): done
  334. Writing superblocks and filesystem accounting information: done
  335.  
  336. This filesystem will be automatically checked every 39 mounts or
  337. 180 days, whichever comes first. Use tune2fs -c or -i to override.
  338. root@wd-virtual-machine:~#
  339. root@wd-virtual-machine:~# # format swap partition
  340. root@wd-virtual-machine:~# mkswap /dev/md1
  341. mkswap: /dev/md1: warning: don't erase bootbits sectors
  342. on whole disk. Use -f to force.
  343. Setting up swapspace version 1, size = 256956 KiB
  344. no label, UUID=427876e7-6c7d-4b71-b765-26d87a21957d
  345. root@wd-virtual-machine:~#
  346. root@wd-virtual-machine:~# # mount
  347. root@wd-virtual-machine:~# mkdir ./sdb1
  348. mkdir: cannot create directory `./sdb1': File exists
  349. root@wd-virtual-machine:~# mkdir ./sdb3
  350. mkdir: cannot create directory `./sdb3': File exists
  351. root@wd-virtual-machine:~# mkdir ./rootfs
  352. mkdir: cannot create directory `./rootfs': File exists
  353. root@wd-virtual-machine:~# mount -o rw,noatime /dev/md0 ./sdb1
  354. root@wd-virtual-machine:~# mount -o rw,noatime /dev/md3 ./sdb3
  355. root@wd-virtual-machine:~# mount -o loop,ro,noatime ./fw/rootfs.arm.ext2 ./rootfs
  356. root@wd-virtual-machine:~#
  357. root@wd-virtual-machine:~# # copy rootfs-files to /sdb1
  358. root@wd-virtual-machine:~# cp -a ./rootfs/* ./sdb1
  359. root@wd-virtual-machine:~#
  360. root@wd-virtual-machine:~# # /var: copy files to /sdb3
  361. root@wd-virtual-machine:~# cp -a ./rootfs/var/* ./sdb3
  362. root@wd-virtual-machine:~#
  363. root@wd-virtual-machine:~# # it's necessary for success
  364. root@wd-virtual-machine:~# echo final_tested_ok > ./sdb1/etc/mfgtest_state
  365. root@wd-virtual-machine:~# echo WCAU44141904 > ./sdb1/etc/serialNumber
  366. root@wd-virtual-machine:~#
  367. root@wd-virtual-machine:~# # set the factory_restore flag -> thats rebuild a clean (=deleted!!!) md2/sda4 after reboot
  368. root@wd-virtual-machine:~# touch ./sdb1/etc/.factory_restore
  369. root@wd-virtual-machine:~#
  370. root@wd-virtual-machine:~#
  371. root@wd-virtual-machine:~#
  372. root@wd-virtual-machine:~#
  373. root@wd-virtual-machine:~# # the file system is ready -> stop Raid
  374. root@wd-virtual-machine:~# umount ./sdb1
  375. root@wd-virtual-machine:~# umount ./sdb3
  376. root@wd-virtual-machine:~# umount ./rootfs
  377. root@wd-virtual-machine:~# mdadm --stop /dev/md0
  378. mdadm: stopped /dev/md0
  379. root@wd-virtual-machine:~# mdadm --stop /dev/md1
  380. mdadm: stopped /dev/md1
  381. root@wd-virtual-machine:~# mdadm --stop /dev/md3
  382. mdadm: stopped /dev/md3
  383. root@wd-virtual-machine:~#
  384. root@wd-virtual-machine:~# # you are ready - shutdown
  385. root@wd-virtual-machine:~# sync
  386. root@wd-virtual-machine:~#
  387. root@wd-virtual-machine:~#
  388. root@wd-virtual-machine:~#
  389. root@wd-virtual-machine:~# # if you use not the original WD 1TB disk now correct the size of sda4
  390. root@wd-virtual-machine:~# # fdisk reads lines of the form <start> <size> <id> <bootable>
  391. root@wd-virtual-machine:~# # When a field is absent or empty, a default value is used.
  392. root@wd-virtual-machine:~# # The default value of size is as much as possible
  393. root@wd-virtual-machine:~# # (until next partition or end-of-disk).
  394. root@wd-virtual-machine:~# echo 4,244,fd>DSKPART
  395. root@wd-virtual-machine:~# echo 248,32,fd>>DSKPART
  396. root@wd-virtual-machine:~# echo 280,123,fd>>DSKPART
  397. root@wd-virtual-machine:~# echo 403,,fd>>DSKPART
  398. root@wd-virtual-machine:~# /sbin/sfdisk --force /dev/sdb <./DSKPART
  399. Checking that no-one is using this disk right now ...
  400. OK
  401.  
  402. Disk /dev/sdb: 243201 cylinders, 255 heads, 63 sectors/track
  403. Old situation:
  404. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
  405.  
  406. Device Boot Start End #cyls #blocks Id System
  407. /dev/sdb1 4 247 244 1959930 fd Linux raid autodetect
  408. /dev/sdb2 248 279 32 257040 fd Linux raid autodetect
  409. /dev/sdb3 280 402 123 987997+ fd Linux raid autodetect
  410. /dev/sdb4 403 121600 121198 973522935 fd Linux raid autodetect
  411. New situation:
  412. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
  413.  
  414. Device Boot Start End #cyls #blocks Id System
  415. /dev/sdb1 4 247 244 1959930 fd Linux raid autodetect
  416. /dev/sdb2 248 279 32 257040 fd Linux raid autodetect
  417. /dev/sdb3 280 402 123 987997+ fd Linux raid autodetect
  418. /dev/sdb4 403 243200 242798 1950274935 fd Linux raid autodetect
  419. Warning: no primary partition is marked bootable (active)
  420. This does not matter for LILO, but the DOS MBR will not boot this disk.
  421. Successfully wrote the new partition table
  422.  
  423. Re-reading the partition table ...
  424. BLKRRPART: Device or resource busy
  425. The command to re-read the partition table failed.
  426. Run partprobe(8), kpartx(8) or reboot your system now,
  427. before using mkfs
  428.  
  429. If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
  430. to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
  431. (See fdisk(8).)
  432. root@wd-virtual-machine:~# sync
  433. root@wd-virtual-machine:~# sfdisk -l
  434.  
  435. Disk /dev/sda: 1044 cylinders, 255 heads, 63 sectors/track
  436. Warning: extended partition does not start at a cylinder boundary.
  437. DOS and Linux will interpret the contents differently.
  438. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
  439.  
  440. Device Boot Start End #cyls #blocks Id System
  441. /dev/sda1 * 0+ 993- 994- 7977984 83 Linux
  442. /dev/sda2 993+ 1044- 51- 407553 5 Extended
  443. /dev/sda3 0 - 0 0 0 Empty
  444. /dev/sda4 0 - 0 0 0 Empty
  445. /dev/sda5 993+ 1044- 51- 407552 82 Linux swap / Solaris
  446.  
  447. Disk /dev/sdb: 243201 cylinders, 255 heads, 63 sectors/track
  448. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
  449.  
  450. Device Boot Start End #cyls #blocks Id System
  451. /dev/sdb1 4 247 244 1959930 fd Linux raid autodetect
  452. /dev/sdb2 248 279 32 257040 fd Linux raid autodetect
  453. /dev/sdb3 280 402 123 987997+ fd Linux raid autodetect
  454. /dev/sdb4 403 243200 242798 1950274935 fd Linux raid autodetect
  455.  
  456. Disk /dev/md_d0: 489952 cylinders, 2 heads, 4 sectors/track
  457.  
  458. sfdisk: ERROR: sector 0 does not have an msdos signature
  459. /dev/md_d0: unrecognized partition table type
  460. No partitions found
  461.  
  462. Disk /dev/md_d3: 246976 cylinders, 2 heads, 4 sectors/track
  463.  
  464. sfdisk: ERROR: sector 0 does not have an msdos signature
  465. /dev/md_d3: unrecognized partition table type
  466. No partitions found
  467.  
  468. Disk /dev/md_d1: 64240 cylinders, 2 heads, 4 sectors/track
  469.  
  470. sfdisk: ERROR: sector 0 does not have an msdos signature
  471. /dev/md_d1: unrecognized partition table type
  472. No partitions found
  473. root@wd-virtual-machine:~#
Advertisement
Add Comment
Please, Sign In to add comment