Ing. Lele's Blog – HeadQuarter

19 July 2012

QNAP TS-212 – How to save RAID settings from telnet

Filed under: Post — Tags: , , , , , — Ing. Lele @ 23:34

Scenario = you have wrongly initialize a new HDD a single disk but you would like to be added as RAID1 disk.

QNap support team suggested to remove all partition and reboot NAS

This should be done connecting the second disk to a computer, delete volume and partition, and connect disk back into the NAS, which is quite boring.

Here is how to delete partition table from telnet:

  1. Open telnet
  2. Login as admin
  3. Check which disk is used as RAID to avoid a “wrong” delete
    mdadm –detail /dev/md0

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8        3        1      active sync  /dev/sda3

  4. So we need to clean the /dev/sdb partitions
    fdisk -l /dev/sdb

    Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1          66      530125   83  Linux
    /dev/sdb2              67         132      530142   83  Linux
    /dev/sdb3             133      121538   975193693   83  Linux
    /dev/sdb4          121539      121600      498012   83  Linux

     

  5. Dismount the volume before starting the work
    umount /dev/sdb3
  6. So we have 4 partition, type the follow to enter in fdisk mode
    fdisk /dev/sdb
  7. If you need help type “m”
  8. List all partition as above, type “p
    Command (m for help): p

    Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1          66      530125   83  Linux
    /dev/sdb2              67         132      530142   83  Linux
    /dev/sdb3             133      121538   975193693   83  Linux
    /dev/sdb4          121539      121600      498012   83  Linux

  9. Press “p” to delete partitions and the number of partition to delete

    Command (m for help): d
    Partition number (1-4): 1

    Command (m for help): d
    Partition number (1-4): 2

    Command (m for help): d
    Partition number (1-4): 3

    Command (m for help): d
    Partition number (1-4): 4

  10. Print all partitions of the disk with “p"
    Command (m for help): p

    Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System

  11. Save the changes with “w
  12. You need to save RAID settings information in the /etc/config/raidtab file
  13. The easy way to save RAID configuration is this:
    more /etc/config/raidtab
    cp /etc/config/raidtab /share/Public 
  14. Change raidtab file like this one

    raiddev /dev/md0
            raid-level      1
            nr-raid-disks   2
            nr-spare-disks  0
            chunk-size      4
            persistent-superblock   1
            device  /dev/sda3
            raid-disk       0
            device  /dev/sdb3
            raid-disk       1

  15. save and copy back to original location
    cp raidtab /etc/config
    more /etc/config/raidtab
  16. Change also /etc/storage.conf file
    Set it only for RAID volume and clear all reference for single volume

    [VOLUME 1]
    device name = /dev/md0
    raid level = 1
    raid disks = 1,0
    spare raid disks =
    status = 0
    record_time = Thu Jul 19 22:53:14 2012

    filesystem = 104
    [Global]
    Available Disk = 2

  17. Reboot the NAS & Check if RAID was rebuilt correctly
About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 961 other followers

%d bloggers like this: