daily pastebin goal
9%
SHARE
TWEET

root

a guest Apr 12th, 2012 16 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ts³11240333140³1version³13³1cache_oldmajor³10³1cache_oldauthor³10³1cache_diff_default_author³11³1revision³11³1tscreate³11240333140³1text_default³1ip³2193.35.132.149³2ts³21240333140³2version³21³2name³2text_default³2data³2summary³3*³3text³3== Current status ==
  2.  
  3. 2x250GB SATA disks
  4.  
  5.  /dev/sda - blank
  6.  
  7.  /dev/sdb1 - / ext3   225G
  8.  /dev/sdb2 - extended
  9.  /dev/sdb5 - swap     6G
  10.  
  11. == Target ==
  12.  
  13.  /dev/sda1 - md0 - 200M Boot    mirrored        /dev/sdb1
  14.  /dev/sda2 - md1 - 2G   Swap    mirrored        /dev/sdb2
  15.  /dev/sda3 - md2 ~ 200G Data    mirrored        /dev/sdb3
  16.  
  17. == High Level Process ==
  18.  
  19. Create necessary partitions on /dev/sda, copy data over, reboot, setup necessary partitions on /dev/sdb, sync mirror.
  20.  
  21. == Detailed Process ==
  22.  
  23. * Install necessary stuff
  24.  apt-get install mdadm lvm2
  25.  
  26. * Insert the module to make the LVM tools work
  27.  modprobe dm-mod
  28.  
  29. * Wipe /dev/sda
  30. * Create partitions
  31. ** Create /dev/sda1 of 200M for /boot
  32. ** Create /dev/sda2 of 2G for /swap
  33. ** Create /dev/sda3 of 200G for /data
  34.  
  35.     Device Boot      Start         End      Blocks   Id  System
  36.  /dev/sda1               1         200     1606468+  83  Linux
  37.  /dev/sda2             201        2048    14844060   83  Linux
  38.  /dev/sda3            2049       30515   228661177+  83  Linux
  39.  
  40.  /dev/sda1               1         200     1606468+  fd  Linux raid autodetect
  41.  /dev/sda2             201        2048    14844060   fd  Linux raid autodetect
  42.  /dev/sda3            2049       30515   228661177+  fd  Linux raid autodetect
  43.  
  44. * Create RAID parts
  45. ** Create md0 for /boot
  46.  $ sudo mdadm --create /dev/md0 --level 1 --raid-devices=2 /dev/sda1 missing
  47.  mdadm: /dev/sda1 appears to contain a reiserfs file system
  48.      size = 56862016K
  49.  Continue creating array? y
  50.  mdadm: array /dev/md0 started.
  51. ** Create md1 for swap
  52.  $ sudo mdadm --create /dev/md1 --level 1 --raid-devices=2 /dev/sda2 missing
  53.  mdadm: array /dev/md1 started.
  54. ** Create md2 for data
  55.  $ sudo mdadm --create /dev/md2 --level 1 --raid-devices=2 /dev/sda3 missing
  56.  mdadm: array /dev/md2 started.
  57.  
  58. * Display disk setup
  59. <pre>
  60.  $ cat /proc/mdstat
  61.  Personalities : [raid1]
  62.  md2 : active raid1 sda3[0]
  63.        228661056 blocks [2/1] [U_]
  64.  
  65.  md1 : active raid1 sda2[0]
  66.        14843968 blocks [2/1] [U_]
  67.  
  68.  md0 : active raid1 sda1[0]
  69.        1606400 blocks [2/1] [U_]
  70.  
  71.  unused devices: <none>
  72. </pre>
  73.  
  74. * Create boot and swap without LVM
  75. ** Create boot filesystem
  76. <pre>
  77. $ sudo mkfs.ext3 /dev/md0
  78. mke2fs 1.40-WIP (14-Nov-2006)
  79. Filesystem label=
  80. OS type: Linux
  81. Block size=4096 (log=2)
  82. Fragment size=4096 (log=2)
  83. 200928 inodes, 401600 blocks
  84. 20080 blocks (5.00%) reserved for the super user
  85. First data block=0
  86. Maximum filesystem blocks=415236096
  87. 13 block groups
  88. 32768 blocks per group, 32768 fragments per group
  89. 15456 inodes per group
  90. Superblock backups stored on blocks:
  91.         32768, 98304, 163840, 229376, 294912
  92.  
  93. Writing inode tables: done
  94. Creating journal (8192 blocks): done
  95. Writing superblocks and filesystem accounting information: done
  96.  
  97. This filesystem will be automatically checked every 29 mounts or
  98. 180 days, whichever comes first.  Use tune2fs -c or -i to override.
  99. </pre>
  100. ** Create swap
  101. <pre>
  102. $ sudo mkswap /dev/md1
  103. Setting up swapspace version 1, size = 15200219 kB
  104. no label, UUID=5d0b63bb-8541-48f6-a97e-fb3eb32404b8
  105. </pre>
  106.  
  107. * Create data partition with LVM
  108.  
  109. ** Prepare the partition for use with lvm
  110.  $ sudo pvcreate /dev/md2
  111.   Physical volume "/dev/md2" successfully created
  112.  
  113.  
  114. ** Create an LVM Volume Group
  115.  $ sudo vgcreate vg00_data /dev/md2
  116.   Volume group "vg00_data" successfully create
  117.  
  118. ** Display the LVM Volume Group
  119.  
  120.  $ sudo vgscan -v
  121.     Wiping cache of LVM-capable devices
  122.     Wiping internal VG cache
  123.   Reading all physical volumes.  This may take a while...
  124.     Finding all volume groups
  125.     Finding volume group "vg00_data"
  126.   Found volume group "vg00_data" using metadata type lvm2
  127.  
  128. ** Create an LVM Logical Volume
  129.  $ sudo lvcreate -L200G -nlv00_data vg00_data
  130.   Logical volume "lv00_data" created
  131.  
  132. ** Display the LVM Logical Volume
  133.  $ sudo lvscan -v
  134.     Finding all logical volumes
  135.   ACTIVE            '/dev/vg00_data/lv00_data' [200.00 GB] inherit
  136.  
  137. ** Create filesystem
  138. <pre>
  139.  $ sudo mkfs.ext3 /dev/vg00_data/lv00_data
  140.  mke2fs 1.40-WIP (14-Nov-2006)
  141.  Filesystem label=
  142.  OS type: Linux
  143.  Block size=4096 (log=2)
  144.  Fragment size=4096 (log=2)
  145.  26214400 inodes, 52428800 blocks
  146.  2621440 blocks (5.00%) reserved for the super user
  147.  First data block=0
  148.  Maximum filesystem blocks=0
  149.  1600 block groups
  150.  32768 blocks per group, 32768 fragments per group
  151.  16384 inodes per group
  152.  Superblock backups stored on blocks:
  153.          32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
  154.          4096000, 7962624, 11239424, 20480000, 23887872
  155.  
  156.  Writing inode tables: done
  157.  Creating journal (32768 blocks): done
  158.  Writing superblocks and filesystem accounting information: done
  159.  
  160.  This filesystem will be automatically checked every 28 mounts or
  161.  180 days, whichever comes first.  Use tune2fs -c or -i to override.
  162. </pre>
  163.  
  164. * Copy data over from sdb to sda
  165.  
  166.  $ sudo telinit 1
  167.  mkdir /mnt/newroot
  168.  mkdir /mnt/newboot
  169.  mkdir /mnt/oldroot
  170.  mount /dev/sdb1 /mnt/oldroot
  171.  mount /dev/vg00_data/lv00_data /mnt/newroot
  172.  cp -p -r /mnt/oldroot/boot/* /mnt/newboot/
  173.  cp -p -r /mnt/oldroot/* /mnt/newroot
  174.  
  175. * Maintain /etc/fstab
  176.  
  177. * Reboot
  178. ³3newauthor³31³3minor³30³2username³2Alan Pope³2host³2193.35.132.149³2revision³21³2tscreate³21240333140³2id³24767³1cache_diff_default_major³11³1cache_diff_default_minor³11c1,177
  179. < Describe the new page here.
  180. ---
  181. > == Current status ==
  182. >
  183. > 2x250GB SATA disks
  184. >
  185. >  /dev/sda - blank
  186. >
  187. >  /dev/sdb1 - / ext3   225G
  188. >  /dev/sdb2 - extended
  189. >  /dev/sdb5 - swap     6G
  190. >
  191. > == Target ==
  192. >
  193. >  /dev/sda1 - md0 - 200M       Boot    mirrored        /dev/sdb1
  194. >  /dev/sda2 - md1 - 2G Swap    mirrored        /dev/sdb2
  195. >  /dev/sda3 - md2 ~ 200G       Data    mirrored        /dev/sdb3
  196. >
  197. > == High Level Process ==
  198. >
  199. > Create necessary partitions on /dev/sda, copy data over, reboot, setup necessary partitions on /dev/sdb, sync mirror.
  200. >
  201. > == Detailed Process ==
  202. >
  203. > * Install necessary stuff
  204. >  apt-get install mdadm lvm2
  205. >  
  206. > * Insert the module to make the LVM tools work
  207. >  modprobe dm-mod
  208. >
  209. > * Wipe /dev/sda
  210. > * Create partitions
  211. > ** Create /dev/sda1 of 200M for /boot
  212. > ** Create /dev/sda2 of 2G for /swap
  213. > ** Create /dev/sda3 of 200G for /data
  214. >
  215. >     Device Boot      Start         End      Blocks   Id  System
  216. >  /dev/sda1               1         200     1606468+  83  Linux
  217. >  /dev/sda2             201        2048    14844060   83  Linux
  218. >  /dev/sda3            2049       30515   228661177+  83  Linux
  219. >
  220. >  /dev/sda1               1         200     1606468+  fd  Linux raid autodetect
  221. >  /dev/sda2             201        2048    14844060   fd  Linux raid autodetect
  222. >  /dev/sda3            2049       30515   228661177+  fd  Linux raid autodetect
  223. >
  224. > * Create RAID parts
  225. > ** Create md0 for /boot
  226. >  $ sudo mdadm --create /dev/md0 --level 1 --raid-devices=2 /dev/sda1 missing
  227. >  mdadm: /dev/sda1 appears to contain a reiserfs file system
  228. >      size = 56862016K
  229. >  Continue creating array? y
  230. >  mdadm: array /dev/md0 started.
  231. > ** Create md1 for swap
  232. >  $ sudo mdadm --create /dev/md1 --level 1 --raid-devices=2 /dev/sda2 missing
  233. >  mdadm: array /dev/md1 started.
  234. > ** Create md2 for data
  235. >  $ sudo mdadm --create /dev/md2 --level 1 --raid-devices=2 /dev/sda3 missing
  236. >  mdadm: array /dev/md2 started.
  237. >
  238. > * Display disk setup
  239. > <pre>
  240. >  $ cat /proc/mdstat
  241. >  Personalities : [raid1]
  242. >  md2 : active raid1 sda3[0]
  243. >        228661056 blocks [2/1] [U_]
  244. >  
  245. >  md1 : active raid1 sda2[0]
  246. >        14843968 blocks [2/1] [U_]
  247. >  
  248. >  md0 : active raid1 sda1[0]
  249. >        1606400 blocks [2/1] [U_]
  250. >  
  251. >  unused devices: <none>
  252. > </pre>
  253. >  
  254. > * Create boot and swap without LVM
  255. > ** Create boot filesystem
  256. > <pre>
  257. > $ sudo mkfs.ext3 /dev/md0
  258. > mke2fs 1.40-WIP (14-Nov-2006)
  259. > Filesystem label=
  260. > OS type: Linux
  261. > Block size=4096 (log=2)
  262. > Fragment size=4096 (log=2)
  263. > 200928 inodes, 401600 blocks
  264. > 20080 blocks (5.00%) reserved for the super user
  265. > First data block=0
  266. > Maximum filesystem blocks=415236096
  267. > 13 block groups
  268. > 32768 blocks per group, 32768 fragments per group
  269. > 15456 inodes per group
  270. > Superblock backups stored on blocks:
  271. >         32768, 98304, 163840, 229376, 294912
  272. >
  273. > Writing inode tables: done
  274. > Creating journal (8192 blocks): done
  275. > Writing superblocks and filesystem accounting information: done
  276. >
  277. > This filesystem will be automatically checked every 29 mounts or
  278. > 180 days, whichever comes first.  Use tune2fs -c or -i to override.
  279. > </pre>
  280. > ** Create swap
  281. > <pre>
  282. > $ sudo mkswap /dev/md1
  283. > Setting up swapspace version 1, size = 15200219 kB
  284. > no label, UUID=5d0b63bb-8541-48f6-a97e-fb3eb32404b8
  285. > </pre>
  286. >
  287. > * Create data partition with LVM
  288. >
  289. > ** Prepare the partition for use with lvm
  290. >  $ sudo pvcreate /dev/md2
  291. >   Physical volume "/dev/md2" successfully created
  292. >
  293. >  
  294. > ** Create an LVM Volume Group
  295. >  $ sudo vgcreate vg00_data /dev/md2
  296. >   Volume group "vg00_data" successfully create
  297. >
  298. > ** Display the LVM Volume Group
  299. >
  300. >  $ sudo vgscan -v
  301. >     Wiping cache of LVM-capable devices
  302. >     Wiping internal VG cache
  303. >   Reading all physical volumes.  This may take a while...
  304. >     Finding all volume groups
  305. >     Finding volume group "vg00_data"
  306. >   Found volume group "vg00_data" using metadata type lvm2
  307. >
  308. > ** Create an LVM Logical Volume
  309. >  $ sudo lvcreate -L200G -nlv00_data vg00_data
  310. >   Logical volume "lv00_data" created
  311. >
  312. > ** Display the LVM Logical Volume
  313. >  $ sudo lvscan -v
  314. >     Finding all logical volumes
  315. >   ACTIVE            '/dev/vg00_data/lv00_data' [200.00 GB] inherit
  316. >
  317. > ** Create filesystem
  318. > <pre>
  319. >  $ sudo mkfs.ext3 /dev/vg00_data/lv00_data
  320. >  mke2fs 1.40-WIP (14-Nov-2006)
  321. >  Filesystem label=
  322. >  OS type: Linux
  323. >  Block size=4096 (log=2)
  324. >  Fragment size=4096 (log=2)
  325. >  26214400 inodes, 52428800 blocks
  326. >  2621440 blocks (5.00%) reserved for the super user
  327. >  First data block=0
  328. >  Maximum filesystem blocks=0
  329. >  1600 block groups
  330. >  32768 blocks per group, 32768 fragments per group
  331. >  16384 inodes per group
  332. >  Superblock backups stored on blocks:
  333. >          32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
  334. >          4096000, 7962624, 11239424, 20480000, 23887872
  335. >  
  336. >  Writing inode tables: done
  337. >  Creating journal (32768 blocks): done
  338. >  Writing superblocks and filesystem accounting information: done
  339. >  
  340. >  This filesystem will be automatically checked every 28 mounts or
  341. >  180 days, whichever comes first.  Use tune2fs -c or -i to override.
  342. > </pre>
  343. >
  344. > * Copy data over from sdb to sda
  345. >  
  346. >  $ sudo telinit 1
  347. >  mkdir /mnt/newroot
  348. >  mkdir /mnt/newboot
  349. >  mkdir /mnt/oldroot
  350. >  mount /dev/sdb1 /mnt/oldroot
  351. >  mount /dev/vg00_data/lv00_data /mnt/newroot
  352. >  cp -p -r /mnt/oldroot/boot/* /mnt/newboot/
  353. >  cp -p -r /mnt/oldroot/* /mnt/newroot
  354. >
  355. > * Maintain /etc/fstab
  356. >
  357. > * Reboot
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top