[HOWTO] Expanding RAID5 from the command line (TS 509)

Questions about SNMP, Power, System, Logs, disk, & RAID.
User avatar
cadillac1960
Starting out
Posts: 10
Joined: Sat Feb 25, 2012 9:38 pm

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by cadillac1960 »

Hi All;

OK, I did many of the steps listed here in the original post, but it was from another source (http://cdonner.com/qnap-raid-expansion.htm) on the web. I am now having a problem of some of my data seemingly dissapeared (still have all original disks so should not be a problem except my time to add all new disks again). Here are my details:

TS-459 Pro II
3 GB RAM
4.0.2 QTS
Warranty EXPIRED Jan 2014

Previously configured with 4 x 3TB Seagate drives

Individually installed my new WD Red 4TB drives, each one installed perfectly and all data was good after it completed the expansion process. So even after installing the 4th drive, all data was there (well I did not check all but all seemed to be there and when I checked a few files to ensure their validity, they checked out on all occasions). All 4 of the original drives are still available, numbered and have not been touched since removed from NAS.

Next step, I needed to expand the capacity to recognize my 16TB of drives. I shut down whatever services I could from the GUI. I then used the following command from a telnet connection to shut down other stuff

Code: Select all

/etc/init.d/services.sh stop
.

I then issued the following command

Code: Select all

umount /dev/md0
and it successfully unmounted md0.

Next I tried the checkdisk

Code: Select all

e2fsck -f /dev/md0
and I received the following messages:
Pass 1: Checking inodes, blocks, and sizes
Inode 75014151 has INDEX_FL flag set on filesystem without htree support.
answer=1
. . . (many more of these entries in the middle here)
Inode 413646858 has INDEX_FL flag set on filesystem without htree support.
answer=1
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/md0: ***** FILE SYSTEM WAS MODIFIED *****
/dev/md0: 1082956/549134336 files (4.5% non-contiguous), 2064360589/2196523152 blocks
[/dev]

I then (and now believe foolishly) went back to the GUI to initiate the expansion. It began at 11:21 pm and failed at 3 am.

When I logged in this morning, the system was running fine, but SOME data was gone. I have verified several files are ok, but my entire "Private" folder is missing as is some of my "Backup" folder data.

So, what are my options here and if anyone knows, what may have happened? I am pretty sure I can just install the original 4 drives (turn off system, put old drives in in original order and turn system back on) and start the rebuild process all over, but as we all know, this is a very long process and if there is any way I can recover my data without doing this, it would be most appreciated. I guess one option would be, shut down system, put original disks back in, reboot, copy data from those disks that I am missing to an external drive, put new disks back in and move that data back over to new disks from the external. My only thing there is, how do I ensure I get all the data that is missing. Is there any way I can do some kind of checksum or something similar to ensure I get all the data from the originals.

If I have left out any details, please let me know so I can update this information.

All help appreciated.

Thanks
W
User avatar
shadowsports
Know my way around
Posts: 228
Joined: Wed Nov 21, 2012 7:53 am
Location: Bay Area

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by shadowsports »

Out of my comfort zone here (I'm a windows guy).

http://en.wikipedia.org/wiki/Comparison ... ison_tools
QNAP TVS-473e 4x 4TB WD REDs - RAID5 - 2x 500GB M.2 (SSD Caching) - 32GB RAM - FW 5.1.0.2466
QNAP TS-219P-II 4TB WD REDs - FW 4.3.3.2420 >>>> Both Protected By UPS <<<<
Z390 AORUS PRO (F10)\850w, 9900K, 32GB GSkill TriZ RGB - 16-18-18-38, RTX 3080Ti FTW3 Ultra, 960 Pro_m.2, W11 Pro
Z370-HD3P (F5)\750w, 8350K, 8GB LPX 3200 - 16-18-18-36, GTX 660 FTW, Intel SSD, W11 Pro
Z97X-UD5H (F8)\Corsair RM850w, 4790K, 16GB Vengeance, GTX970 FTW SC 4GB ACX 2.0, 850 Pro's RAID0, W10 Pro
Phone - Pixel8
KaPOW!
thewizarduk
New here
Posts: 7
Joined: Sun Jun 23, 2013 4:14 pm

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by thewizarduk »

Hans_Wurst
Starting out
Posts: 13
Joined: Tue Mar 01, 2011 1:58 am

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by Hans_Wurst »

Hello!

I have a problem with my TS 669L / FW 4.1.0 / 4x Samsung 4TB ST4000DM000 / RAID5.
The System was running fine for a lot of months now.
But it was running out of space slowly (800GB free left), so I decided to add another 4TB drive of same brand and model and used the "Add drive" function in the QNAP RAID management web front end.

All went fine until tonight the process finished with "rebuilding complete" followed by "Expanding RAID device failed".

So, I checked the RAID Volume in the web frontend and noticed that by now I have a RAID5 Volume consisting of 5x HDD BUT with the same amount of storage as before.
Now I tried to expand the RAID volume again in RAID Management. The website showed the correct size (current size 10.8, able to expand to 14.x) so I hit go. After about 17% I've got the same error message again ("Expanding RAID device failed").

I searched this forum (which helped me a lot in the past already, thanks!!) for a solution and found this sticky thread "[HOWTO] Expanding RAID5 from the command line (TS 509)" which I am currently replying to.

I have followed this How To and was successful until:

[/] # resize2fs /dev/md0
resize2fs 1.41.4 (27-Jan-2009)
Resizing the filesystem on /dev/md0 to 3905449536 (4k) blocks.
resize2fs: Memory allocation failed while trying to resize /dev/md0

So, I created an addition SWAP file as suggested in this thread:

[/share/external/DEV3306_1] # dd if=/dev/zero of=swapfile bs=1024 count=1024k
1048576+0 records in
1048576+0 records out
[/share/external/DEV3306_1] # mkswap -c swapfile
Setting up swapspace version 1, size = 1073737 kB
no label, UUID=31f36a2e-3dff-40e5-9a8b-1062dde3c0e1
[/share/external/DEV3306_1] # swapon /share/external/DEV3306_1/swapfile
[/share/external/DEV3306_1] # cat /proc/swaps
Filename Type Size Used Priority
/dev/md256 partition 530108 21100 -1
/share/external/DEV3306_1/swapfile file 1048568 0 -2
[/share/external/DEV3306_1] # cd /

But again I've got:

[/] # resize2fs /dev/md0
resize2fs 1.41.4 (27-Jan-2009)
Resizing the filesystem on /dev/md0 to 3905449536 (4k) blocks.
resize2fs: Memory allocation failed while trying to resize /dev/md0

Does anyone has an idea how I can proceed and get the expansion working?

Thanks in advance and greetings from Germany (sorry for my possibly bad english...).

Best regards
Thomas
Hans_Wurst
Starting out
Posts: 13
Joined: Tue Mar 01, 2011 1:58 am

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by Hans_Wurst »

Hello again.

I think I have fixed it on my own.

I created an even bigger swap file (2GB) on my external USB 3.0 drive. 1 GB additional SWAP was not enough.
With this new 2GB swap file, everything went good:

[/] # resize2fs /dev/md0
resize2fs 1.41.4 (27-Jan-2009)
Resizing the filesystem on /dev/md0 to 3905449536 (4k) blocks.
The filesystem on /dev/md0 is now 3905449536 blocks long.

[/] # e2fsck -n /dev/md0
e2fsck 1.41.4 (27-Jan-2009)
Volume1: clean, 352110/488181760 files, 2706399278/3905449536 blocks
[/] # tune2fs -j /dev/md0
tune2fs 1.41.4 (27-Jan-2009)
Creating journal inode: done
This filesystem will be automatically checked every -1 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
[/] # reboot

I would not have expected that resize2fs is using so much memory...
BTW: Even in the web frontend of the QNAP the size is showed correctly: 14.4 TB

Now I'm very happy. :-)

A big "thank you" goes out to everyone who has contributed to this thread.

Best regards & a nice weekend to all
Thomas
hehejo
First post
Posts: 1
Joined: Sat Oct 11, 2014 6:34 pm

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by hehejo »

These steps worked very well.
However, I had to “create” more swap space. I used the commands described by http://cdonner.com/qnap-raid-expansion.htm: identify the “swap raid”, stop it and use each of the 4 partitions as swap space.
User avatar
spamkutu
Know my way around
Posts: 112
Joined: Sun Aug 09, 2015 4:09 pm

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by spamkutu »

PK_TS509 wrote:
5.) Turn off all network mounts.

From the Web Admin page go to the Network Settings and disable the following services:
  • • Microsoft Networking
    • Apple Networking
    • NFS Service
    • Web File Manager
    • FTP Service
    • Multimedia Station
    • iTunes Service
    • Download Station
    • Web Server
    • MySQL Server

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ where is the command line :roll: ??
Model name: TVS-EC-1080 + 24GB RAM
Firmware version: 4.1.4 20150910 stable
Operation System (OS): Windows XP/7/8.1/2012SR2 ; Slackware 14.1
Number of HDDs: 8 Segate NAS ST4000VN000-1H4168 ; 4TB each ; First 4 in Raid 5 , Next 4 in Raid 5
Services enabled: DDNS, NFS, SMB, SSH, SysLog, LDAP, Photo, Music, File and Download Station
NAS connection speed/ MTU: 1Gbps / 1500
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by pwilson »

spamkutu wrote:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ where is the command line :roll: ??
It is in the same place it has always been. You can access it via SSH. :DD

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
User avatar
spamkutu
Know my way around
Posts: 112
Joined: Sun Aug 09, 2015 4:09 pm

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by spamkutu »

pwilson wrote:
spamkutu wrote:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ where is the command line :roll: ??
It is in the same place it has always been. You can access it via SSH. :DD
Ssh have web admin page I'm surprised :shock:
Model name: TVS-EC-1080 + 24GB RAM
Firmware version: 4.1.4 20150910 stable
Operation System (OS): Windows XP/7/8.1/2012SR2 ; Slackware 14.1
Number of HDDs: 8 Segate NAS ST4000VN000-1H4168 ; 4TB each ; First 4 in Raid 5 , Next 4 in Raid 5
Services enabled: DDNS, NFS, SMB, SSH, SysLog, LDAP, Photo, Music, File and Download Station
NAS connection speed/ MTU: 1Gbps / 1500
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by schumaku »

spamkutu wrote:Ssh have web admin page I'm surprised
stay far away ... this does not apply to your new NAS system with the flexible volume manager at all ...
User avatar
spamkutu
Know my way around
Posts: 112
Joined: Sun Aug 09, 2015 4:09 pm

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by spamkutu »

I though all qnap x86s use some structure dosen't it?
Model name: TVS-EC-1080 + 24GB RAM
Firmware version: 4.1.4 20150910 stable
Operation System (OS): Windows XP/7/8.1/2012SR2 ; Slackware 14.1
Number of HDDs: 8 Segate NAS ST4000VN000-1H4168 ; 4TB each ; First 4 in Raid 5 , Next 4 in Raid 5
Services enabled: DDNS, NFS, SMB, SSH, SysLog, LDAP, Photo, Music, File and Download Station
NAS connection speed/ MTU: 1Gbps / 1500
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by pwilson »

spamkutu wrote:I though all qnap x86s use some structure dosen't it?
Nope. Check out Page1 of the QNAP Turbo NAS User Manual (SMB Version) to see the models it applies to, including yours.

The TS-509 model (ie subject of this message thread) is a Intel x86 NAS model, but it uses the "Home" version of the Firmware, and therefore the "Home" version of the manual.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
johny5_uk
Starting out
Posts: 11
Joined: Sat Apr 21, 2012 3:21 am

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by johny5_uk »

could i please have some help or direction on my qnap ts419pii.... (raid 10)

I had 4 x 3tb drives and have upgraded one by one to 4tb using the web gui "expanding" option.
after all drives had been upgraded I then clicked "expand" for the array and it failed.

I have followed this thread to kill all processes and do a manual expand but I then get the following message:

resize2fs /dev/md0
resize2fs 1.42.6 (21-Sep-2012)
The filesystem is already 1464348768 blocks long. Nothing to do!


when i run: mdadm -D /dev/md0

I get the following:

/dev/md0:
Version : 01.00.03
Creation Time : Wed Oct 10 00:24:54 2012
Raid Level : raid10
Array Size : 5857395072 (5586.05 GiB 5997.97 GB)
Used Dev Size : 2928697536 (2793.02 GiB 2998.99 GB)
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Tue Dec 29 19:28:56 2015
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

Layout : near=2, far=1
Chunk Size : 64K

Name : 0
UUID : e19552ab:4528975f:acdfbb0b:8ac3218b
Events : 122519

Number Major Minor RaidDevice State
6 8 3 0 active sync /dev/sda3
5 8 19 1 active sync /dev/sdb3
4 8 35 2 active sync /dev/sdc3
7 8 51 3 active sync /dev/sdd3



One other thing I thought was strange is that in all the web gui it says my raid is 5 yet it is actually raid 10 and also says this in the cli.

many thanks in advance.
User avatar
paolomarino
Easy as a breeze
Posts: 309
Joined: Sat Jun 13, 2009 3:24 am
Location: Ironforge

Re: [HOWTO] Expanding RAID5 from the command line (TS 509)

Post by paolomarino »

84 Hours !!!

Changed my 5 1TB Seagate (with too much relocated sectors) with 5 4TB WD

Made online migration following this topic instructions

All works fine :D Thanks to the Author :)

Now I have a new shiny 14.7TB Raid 5 Ext3 Volume ;)

Note 1: To unmount the Volume I needed to find the locks with "lsof" and then I killed all process one by one
Note 2: I needed 2*2GB swap files on a USB drive to end the resize or it fails
Note 2: I have the version 2 of 509 M.B. that supports disk larger than 2TB
Happy Qnap TS-509 Ultra (Intel E7500 + 2GB RAM + 20TB WD RED) Owner :)
Happy Qnap TS-870 Ultra (Intel I7-3770T + 16GB RAM + 64TB WD RED) Owner :)
Post Reply

Return to “System & Disk Volume Management”