Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Last thing we have to do, get the RAID array back together.
- # Power down the NAS
- # Put back the drive you pulled before
- # Start netcat on your target pc (Just to be sure)
- # Power on the NAS
- # In a few minutes, you should be able to login to the NAS (if not, check the bootlog in netcat)
- # --------------------------
- # Update: 17-05-2013
- # If you need to reconstruct a drive with the same partition layout
- # Login as root:
- parted
- # Disk selection in parted
- # The LS-WVL has two drive bays: left (A) is /dev/sda and the right drive bay (B) is /dev/sdb
- # Parted selects the lowest possible drive at start.
- # First we need to get the partitions on the drive which contains your data. So if your data
- # is on the right partition, run
- select /dev/sdb
- # If it's on the left partition, this drive is already selected. You can select it either way with
- select /dev/sda
- # You will get feedback like
- # (parted) select /dev/sdb
- # Using /dev/sdb
- # Now we get the partition table
- unit s # Select sectors as unit, so you have the most exact way of replicating the drive
- print # Print the partition table
- # Mine for example is this:
- # (parted) print
- # Model: ATA ST3000DM001-9YN1 (scsi)
- # Disk /dev/sda: 5860533168s
- # Sector size (logical/physical): 512B/4096B
- # Partition Table: gpt # <<< HERE IS YOUR PARTITION TABLE
- # Number Start End Size File system Name Flags
- # 1 2048s 2002943s 2000896s ext3 primary
- # 2 2002944s 12003327s 10000384s primary
- # 3 12003328s 12005375s 2048s primary
- # 4 12005376s 12007423s 2048s primary
- # 5 12007424s 14008319s 2000896s primary
- # 6 14008320s 5843758319s 5829750000s primary
- # Now select the other drive (empty drive)
- select /dev/sdb # Select /dev/sda if the LEFT drive is the empty drive
- # Create the partition table. The output of your previous 'print' command gave a partition label.
- mklabel gpt
- # Recreate every partition using mkpart, in the same order.
- # mkpart [name] [start] [end] # See here: http://www.gnu.org/software/parted/manual/html_node/mkpart.html
- # For me, the commands were
- mkpart primary 2048 2002943
- mkpart primary 2002944 12003327
- mkpart primary 12003328 12005375
- mkpart primary 12005376 12007423
- mkpart primary 12007424 14008319
- mkpart primary 14008320 5843758319
- # USE YOUR OWN VALUES. ONLY FOR DEMONSTRATION
- # Now you can use 'print' again. Compare the two outputs. All three columns (Start, End and Size) should
- # be EXACTLY the same. File System and Name will come later.
- print
- # If everything suits you, exit parted with
- quit
- # -------------------------------
- # Rebuild RAID
- # -------------------------------
- # Log in as root, if you're not already are.
- # You have 4 partitions: boot, root, data and swap.
- # partition device drive
- # boot /dev/md0 /dev/sda1
- # root /dev/md1 /dev/sda2
- # data /dev/md2 /dev/sda6
- # swap /dev/md10 /dev/sda5
- # (if you pulled/replaced the left drive, you will have sdbX instead of sdaX)
- # Cross check this table with your own NAS:
- cat /proc/mdstat
- # Example output:
- # md1 : active raid1 sda2[0]
- # 4999156 blocks super 1.2 [2/1] [U_]
- # md1 - device
- # sda2 - drive
- # [2/1] - 1 of 2 drives are working in the RAID array
- # Normally:
- # sda1 -> sdb1
- # sda2 -> sdb2
- # etc etc...
- mdadm --manage /dev/md0 --add /dev/sdb1
- # /dev/md0 - the device we are managing
- # /dev/sdb1 - the drive we are adding. Note that we are ADDing sdB1
- # Do this for all 4 partitions:
- # mdadm --manage /dev/md0 --add /dev/sdb1
- # mdadm --manage /dev/md1 --add /dev/sdb2
- # etc etc...
- # You can check the progress of rebuilding the RAID array with:
- cat /proc/mdstat
- # For me, rebuilding 3TB took ~400 minutes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement