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

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

QNAP TS-212 How to rebuild RAID manually from telnet

Scenario = replace a disk in QNAP TS-212 with RAID 1 configuration active

RAID rebuild should start automatically, but some times it could happen you got stuck with 1 Single Disk + 1 Mirroring Disk Volume:

SingleDisk

According to the QNAP Support – How can I migrate from Single Disk to RAID 0/1 in TS-210/TS-212? , TS-210/TS-212 does not support Online RAID Level Migration. Therefore, please backup the data on the single disk to another location, install the second hard drive, and then recreate the new RAID 0/1 array (hard drive must be formatted).

The workaround is this:

  1. Telnet to NAS as Admin
  2. Check your current disk configuration for Disk #1 and Disk #2 =
    fdisk -l /dev/sda

    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

    fdisk -l /dev/sdb

    Disk /dev/sda: 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/sda1               1          66      530125   83  Linux
    /dev/sda2              67         132      530142   83  Linux
    /dev/sda3             133      121538   975193693   83  Linux
    /dev/sda4          121539      121600      498012   83  Linux

  3. SDA is the first disk, SDB is the second disk
  4. Verify the current status of RAID with this command =
    mdadm –detail /dev/md0

    /dev/md0:
            Version : 00.90.03
      Creation Time : Thu Sep 22 21:50:34 2011
         Raid Level : raid1
         Array Size : 486817600 (464.27 GiB 498.50 GB)
      Used Dev Size : 486817600 (464.27 GiB 498.50 GB)
       Raid Devices : 2
      Total Devices : 1
    Preferred Minor : 0
        Persistence : Superblock is persistent

      Intent Bitmap : Internal

        Update Time : Thu Jul 19 01:13:58 2012
              State : active, degraded
    Active Devices : 1
    Working Devices : 1
    Failed Devices : 0
      Spare Devices : 0

               UUID : 72cc06ac:570e3bf8:427adef1:e13f1b03
             Events : 0.1879365

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

  5. As you can see the /dev/sda3 is working, so disk #1 is OK, but disk #2 is missing from RAID
  6. Check if Disk #2 /dev/sdb is mounted (it should be) =
    mount

    /proc on /proc type proc (rw)
    none on /dev/pts type devpts (rw,gid=5,mode=620)
    sysfs on /sys type sysfs (rw)
    tmpfs on /tmp type tmpfs (rw,size=32M)
    none on /proc/bus/usb type usbfs (rw)
    /dev/sda4 on /mnt/ext type ext3 (rw)
    /dev/md9 on /mnt/HDA_ROOT type ext3 (rw)
    /dev/md0 on /share/MD0_DATA type ext4 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,delalloc,noacl)
    tmpfs on /var/syslog_maildir type tmpfs (rw,size=8M)
    /dev/sdt1 on /share/external/sdt1 type ufsd (rw,iocharset=utf8,dmask=0000,fmask=0111,force)
    tmpfs on /.eaccelerator.tmp type tmpfs (rw,size=32M)
    /dev/sdb3 on /share/HDB_DATA type ext3 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,noacl)

  7. Dismount the /dev/sdb3 Disk #2 with this command =
    umount /dev/sdb3
  8. Add Disk #2 into the RAID /dev/md0 =
    mdadm /dev/md0 –add /dev/sdb3

    mdadm: added /dev/sdb3

  9. Check the RAID status and the rebuild should be started automatically =
    mdadm –detail /dev/md0

    /dev/md0:
            Version : 00.90.03
      Creation Time : Thu Sep 22 21:50:34 2011
         Raid Level : raid1
         Array Size : 486817600 (464.27 GiB 498.50 GB)
      Used Dev Size : 486817600 (464.27 GiB 498.50 GB)
       Raid Devices : 2
      Total Devices : 2
    Preferred Minor : 0
        Persistence : Superblock is persistent

      Intent Bitmap : Internal

        Update Time : Thu Jul 19 01:30:27 2012
              State : active, degraded, recovering
    Active Devices : 1
    Working Devices : 2
    Failed Devices : 0
      Spare Devices : 1

    Rebuild Status : 0% complete

               UUID : 72cc06ac:570e3bf8:427adef1:e13f1b03
             Events : 0.1879848

        Number   Major   Minor   RaidDevice State
           2       8       19        0      spare rebuilding   /dev/sdb3
           1       8        3        1      active sync   /dev/sda3

  10. Check the NAS site for the rebuild % progress

    image

  11. After the RAID rebuild complete, restart NAS to clean all previous mount point folder for sdb3

File System compare – Fat32, EXT2, EXT3

All information needed to compare FAT32, NTFS, EXT2 and EXT3 file system are available at Wikipedia – Comparison of file systems
This is really useful to choose the better file system for the NAS because it’s OS-free and depends only by the firmware capability: actually, it can support FAT32, EXT2 and EXT3.

According to the wikipedia article, the best one is the EXT3 because it can easily recover from a power failure thanks to the journal.

So, I need to find a wait to backup the whole NAS and conver both disks to EXT3… 🙂

MRT 35HD-DUAL-NAS-E Hardware components


A working Tinky firmware is now available and we activate a support Forum for users

More information about the Serial Port connector and adapter circuit.
JP2 is serial port connector. Pinout =

  1. Vcc (pin 1 is next to GPIO:21)
  2. TxD
  3. RxD
  4. NC
  5. GND

CPU

Gemini SL3516 Network Processor is the heart of the NAS system:
The Gemini SL3516 Network Processor provides superior performance and functionality for Router Gateway, NAS, IP Set Top Box, VoIP and other SME and SOHO applications. The device has single 32-bit ARM9 RISC Processors with up to 400MIPS total performance. The device integrates a full featured hardware crypto engine, two 10/100/1000 Ethernet MACs, dual USB2.0 hosts or clients, dual IDE or SATA interfaces, a 66MHz 32-bit PCI interface, and direct interfaces to color LCD and SLIC modules. The device also includes an intelligent and programmable power management unit for portable system applications.

RAM

It’s a 32Mb DDR chipset made by Nanya Technology Corporation.
  • Part Number = NT5DS32M16BS-5T
  • Voltage = 2.5V
  • Refresh = 8K
  • Package = 66-Pin TSOP(II)
  • Speed = 333/400 DDR

100/1000 Base-T Transformer

It’s a chip made by Magtek Technology Inc.
  • Part Number = G24102MK
  • Turns Ratio [TX:RX]= 1CT:1CT
  • Operating Temperature = Standard Temp
  • Package = 24PIN/SMD

PDF Technical Specification are available.

Gigabit Ethernet Transceivers

It’s a chip made by Marvel Corporate

  • Part Number = 88E1111
  • Description = Single Multi-Interface Transceiver

PDF Technical Specification are available.

Flash ROM memory

It’s a chip made by Spansion Corp

  • Density = 128Mb
  • Voltage = 3Volt
  • Interface = Page-mode
  • Process Technology = 110 nm MirrorBit™ technology
  • Bus Width = x8/x16
  • Sector Type = Uniform
  • Initial Access Times (ns) = 90/100/110
  • Page Mode Access Times (ns) = 25/30
  • Package Options = 56-pin TSOP / 64-ball Fortified BGA
  • Temperature Range = -40°C to +85°C / -25°C to +85°C

PDF Technical Specification are available.

MRT 35HD-DUAL-NAS-E Performance

Finally, I got the NAS at home and tested the transfert rate.
The connection between the PC and NAS is made with a Linksys running DD-WRT v23 SP2 (09/15/06) voip firmware.
I installed 1 Western Digital & 1 Seagate: both SATA 250Gb HDDs.
NAS firmware version is the original MRT G5S52256202, then I will upgrade the firmware to Tinky.

This is the perfmon of the NAS transfering small files: 5.67 Mb/s average