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

Questions about SNMP, Power, System, Logs, disk, & RAID.
fabsah
New here
Posts: 9
Joined: Mon Dec 26, 2011 1:51 am

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

Post by fabsah »

This Howto made my day. I was stuck while expanding my RAID5, these instructions solved my problem. Thanks a bunch to the parents !

It's a pity to see QNAP adding gadgets (Music Station, really ?! WTF !) on every firmware upgrade while vital feature have been unstable for years. Reconstructing and expanding a RAID array should be a flawless experience. On my unit, it ** big time. And YES my data are backed up on several 2Tb USB2 HDD. But it would take days to delete/recreate an array and copy back the data.

(TS-659-Pro II with Western Digital RE4-2To, RAM : 3Gb, lastest firmware, UPS and the whole shebang).

Anyway, thanks again for saving my **.

edit : typos.
Last edited by fabsah on Mon Apr 23, 2012 3:38 am, edited 1 time in total.
fabsah
New here
Posts: 9
Joined: Mon Dec 26, 2011 1:51 am

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

Post by fabsah »

Turist wrote:Hello there

same problem with adding 4-th disk to 3-disk RAID5 here.

tried to follow the guide, but failed to unmount md0
stopped all services through web interface (and services.sh stop)
killed transmission, apcupsd but no luck
I had the same problem. Turned out I still had a directory mounted as /share/Qdownload (from the rtorrent++ qpkg).
A simple umount /share/Qdownload solved my issue and I was able to follow this Howto to the letter afterward.

Check your fstab/mtab

It might help to terminate all services issuing /etc/init.d/services.sh stop , as mentioned on a previous post.
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 »

carolprincess wrote:My raid is in read only mode, because of a failed drive, I am trying to replace a disk, but my QNAP will not add disk, it just says Failed to add drive
website development
Any idea Whats the issue?
Have you tried using the "standard method": Hot-swapping the hard drives when the RAID crashes. Why is this even being attempted at the command line?

Patrick.

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.
lmolenaar
Know my way around
Posts: 164
Joined: Mon May 19, 2008 4:34 pm
Location: Geldrop
Contact:

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

Post by lmolenaar »

Thank you very much for this HowTo, the GUI expand button did not work for me and this resulted in success!!

I have a question remaining about the disk size, is this the expected size when using 3TB disks in raid 5? I found several online RAID configurators (link1 and link2) and both tell me the usable disk size should be 10410.39 and not the 10996.78 GB the GUI shows

My drives:
Image

[~] # df /dev/md0

Code: Select all

Filesystem                Size      Used Available Use% Mounted on
/dev/md0                 10.7T      6.7T      4.0T  63% /share/MD0_DATA
100Mb WAN <--> Asus RT-N56u <--> TS-509 Pro ultra (E7500, 4GB, 5x 3TB Seagate)
(Optware/Pure-ftpd/SSOT/SABNZBd/Sickbeard/Couchpotato)
What seems to be the officer problem?
Greenious
Starting out
Posts: 23
Joined: Tue Sep 02, 2008 4:36 am

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

Post by Greenious »

lmolenaar wrote:Thank you very much for this HowTo, the GUI expand button did not work for me and this resulted in success!!

I have a question remaining about the disk size, is this the expected size when using 3TB disks in raid 5? I found several online RAID configurators (link1 and link2) and both tell me the usable disk size should be 10410.39 and not the 10996.78 GB the GUI shows
http://en.wikipedia.org/wiki/Hard_disk_drive#Capacity

You need to insert the correct numbers. Those calculators seem to be aligned with the capacity standard used by hdd manufacturers, and not the (actually correctly) size reported by QNAP.

Also, QNAP reserves some space on the drives for it's own purposes.
User avatar
ForSSkieken
Getting the hang of things
Posts: 61
Joined: Thu Sep 25, 2008 2:48 am
Location: Wijnegem

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

Post by ForSSkieken »

pwilson wrote:
carolprincess wrote:My raid is in read only mode, because of a failed drive, I am trying to replace a disk, but my QNAP will not add disk, it just says Failed to add drive
website development
Any idea Whats the issue?
Have you tried using the "standard method": Hot-swapping the hard drives when the RAID crashes. Why is this even being attempted at the command line?

Patrick.

Hi Patrick,

If you do it by command Line and you understand what is happening you can always repair your RAID.

Why rely on crappy soft if you can do it your self. QNAP doesn't support my TS-509 they don't even help me anymore with skype or via hotmail, even if they do You'll have to wait until they are available. This is of course normal, but when I can repair my system I don't have to wait.

I can always fall back on back-ups but rebuilding takes like forever with that amount of data
We have a saying...what you do yourself you're probably doing better.
============================================================================================
TS-869L [RAID 5] Thick Provisioning 1 volume 6* 4TB


---------------------------------------------------------------------------------------------------------------------------------
TrueNAS on DELL R520
3 PC's in Workgroup
============================================================================================
User avatar
ForSSkieken
Getting the hang of things
Posts: 61
Joined: Thu Sep 25, 2008 2:48 am
Location: Wijnegem

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

Post by ForSSkieken »

patrickgraf wrote:
UnkyPhil wrote:Hi PK_TS509,

I am sad to report that I had to use your post to solve an Add Disk failure on my new TS-410. Happy to report that it fixed my problem... well nearly fixed it.

The array is now 4 disks and 4TB as expected, but in the Web Admin interface it still shows as 3 Disks with the 4th Disk Unmounted. This is obviously wrong, as I can certainly see the full disk space and the lights on the NAS flicker as I would expect when disk access happens i.e. all 4 disk lights flash as I am used to seeing with RAID5 arrays.

So, I am wondering if you know how to fix the Web Admin Interface to tell the truth?

You seem to know what is going on under the hood. I assume using Linux skills. Unfortunately, I'm a very techie Windows person with only limited Linux skills. I will be asking QNAP for support, but thought you might be able to help solve this problem faster than they do.

Thanks for the post and hopefully your help.

Regards Phil
Heyhey
had the same problem after expanding...
I'm new to this whole QNAP NAS THING but here something that worked for me.

I added a 5th disk to my 4disk RAID 5 following the first post. it worked, but also showed 4+1 disk in the web interface.

Solution:

1.In /etc/storage.conf delete the single disk record completely. (in my case the disk /dev/sde3)
2.Then add the disk number to the “raid disks=" line.(in my case I only added ",5" )
After that it should show the right config in your webinterface.


[VOLUME 1]
device name = /dev/sde3
raid level = -2
raid disks = 5
spare raid disks =
status = -3
record_time = Thu Feb 11 10:58:33 2010

filesystem = 103
[VOLUME 2]
device name = /dev/md0
raid level = 5
raid disks = 1,2,3,4
spare raid disks =
status = 0
record_time = Thu Feb 11 10:58:33 2010

filesystem = 103
[Global]
Available Disk = 5
[VOLUME 5]
status = -3
[~] #

Greetings from switzerland :) ( sorry about my english )

Hi I have the same problem:
My webpage is not aware when I mount my /dev/md0 /share/MD0_DATA -t ext4
In reality I can open my files, but it's anoying to do this everytime manualy

This is my config but it seems it's rewritten (I loose the [VOLUME 6]) if I do a refresh of the webpage

Does anybody has a clue?

[VOLUME 1]
device name = /dev/sda3
raid level = -2
raid disks = 1
spare raid disks =
status = -3
record_time = Sun Oct 14 14:59:25 2012

filesystem = 104
[VOLUME 2]
device name = /dev/sdb3
raid level = -2
raid disks = 2
spare raid disks =
status = -3
record_time = Sun Oct 14 14:59:25 2012

filesystem = 104
[VOLUME 3]
device name = /dev/sdc3
raid level = -2
raid disks = 3
spare raid disks =
status = -3
record_time = Sun Oct 14 14:59:25 2012

filesystem = 104
[VOLUME 4]
device name = /dev/sdd3
raid level = -2
raid disks = 4
spare raid disks =
status = -3
record_time = Sun Oct 14 14:59:25 2012

filesystem = 104
[VOLUME 5]
device name = /dev/sde3
raid level = -2
raid disks = 5
spare raid disks =
status = -5
record_time = Sun Oct 14 14:59:25 2012

filesystem = 104

[VOLUME 6]
device name = /dev/md0
raid level = 5
raid disks = 1,2,3,4
spare raid disks =
status = 0
record_time = Sun Oct 14 14:59:25 2012

filesystem = 104
[Global]
Available Disk = 4
============================================================================================
TS-869L [RAID 5] Thick Provisioning 1 volume 6* 4TB


---------------------------------------------------------------------------------------------------------------------------------
TrueNAS on DELL R520
3 PC's in Workgroup
============================================================================================
User avatar
ForSSkieken
Getting the hang of things
Posts: 61
Joined: Thu Sep 25, 2008 2:48 am
Location: Wijnegem

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

Post by ForSSkieken »

It seems my /etc/config/raidtab was empty

this is how it should be
raiddev /dev/md0
raid-level 5
nr-raid-disks 4
nr-spare-disks 0
chunk-size 4
persistent-superblock 1
device /dev/sda3
raid-disk 0
device /dev/sdb3
raid-disk 1
device /dev/sdc3
raid-disk 2
device /dev/sdd3
raid-disk 3
============================================================================================
TS-869L [RAID 5] Thick Provisioning 1 volume 6* 4TB


---------------------------------------------------------------------------------------------------------------------------------
TrueNAS on DELL R520
3 PC's in Workgroup
============================================================================================
User avatar
chrispage
Getting the hang of things
Posts: 62
Joined: Sun May 01, 2011 1:53 am
Location: Melbourne Australia
Contact:

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

Post by chrispage »

Hello QNAPPERS

Its been just on a WEEK since i started the long long long process of migrating my raid 5 ext4 from 6x2tb to 6x3tb on my TS-659 Pro II.

The 6 drive replacements went fine, all showing up and synced. But i did not know about the problems with capacity migrations so I started the expansion process 40hours ago and its just been sitting on 50%! I want to try the expansion from the shell but now that i have started it this way, can i stop it??
(Expansion via shell cmd http://forum.qnap.com/viewtopic.php?f=2 ... =30#p56331)

I didn't stop any services, i didnt unmount .. nadda. I figured it would just do what it had to do.

Ok after i realized it MAY not be actually working, i checked the forums and here i am. I ssh'ed into the box and stopped all the services by issuing /etc/init.d/Qthttph.sh stop and /etc/init.d/services and the disabling in the GUI.

(service stopping hangs at trying to stop sickbeard)

HELP!


Do i have to let this expand job finish or can i unmount it and follow these steps?? Will it even finish ??

http://forum.qnap.com/viewtopic.php?f=2 ... =30#p56331
Last edited by chrispage on Fri Dec 07, 2012 4:50 am, edited 2 times in total.
QNAP TS-653 Pro 8G
QTS: 4.2 Beta
Raid 5 - 6x3TB WD Red)
User avatar
doktornotor
Ask me anything
Posts: 7472
Joined: Tue Apr 24, 2012 5:44 am

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

Post by doktornotor »

chrispage wrote: PLEASE HELP!!!
QNAP Customer Service
I'm gone from this forum till QNAP stop wasting volunteers' time. Get help from QNAP helpdesk instead.
Warning: offensive signature and materials damaging QNAP reputation follow:
QNAP's FW security issues
QNAP's hardware compatibility list madness
QNAP's new logo competition
Dear QNAP, kindly fire your clueless incompetent forum "admin" And while at it, don't forget the webmaster!
searcher1
New here
Posts: 2
Joined: Sun Dec 16, 2012 1:41 pm

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

Post by searcher1 »

Hello firstly thank you for an excellent guide, I have been in contact with QNAP support for numerous days to no avail. I used to have 4 x 2TB drives in my QNAP and recently I purchased 2 x 4TB drives and swapped out two of the 2TB. The QNAP rebuilt the RAID fine. Only thing the expand volume is greyed out.

When I went through these instructions the final step advises The filesystem is already 1463959200 blocks long. Nothing to do!

I am confused I thought the RAID 5 wastes one of the largest drives hence I should have 4tb plus the 2 2tbs?

urrent Configuration : Physical Disks
Disk Model Capacity Status Bad Blocks Scan SMART Information
Drive 1 Hitachi HDS5C4040ALE630 MPAO 3726.02 GB Ready Scan now Good
Drive 2 Hitachi HDS5C4040ALE630 MPAO 3726.02 GB Ready Scan now Good
Drive 3 Hitachi HDS722020ALA330 JKAO 1863.02 GB Ready Scan now Good
Drive 4 Hitachi HDS722020ALA330 JKAO 1863.02 GB Ready Scan now Good

Hence I still have the same space as before the swap and the QNAP techinician asdvise it is because the new drives are not supported someone please help as I have spent a lot of money on the new drives. Thanking you in advance Michael
User avatar
doktornotor
Ask me anything
Posts: 7472
Joined: Tue Apr 24, 2012 5:44 am

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

Post by doktornotor »

searcher1 wrote: I am confused I thought the RAID 5 wastes one of the largest drives hence I should have 4tb plus the 2 2tbs?
Uhm... This is NOT possible. The capacity for RAID-5 is

Code: Select all

(N - 1) * size of smallest HDD in array
IOW, you need to replace ALL the drives with bigger ones to get more space.
I'm gone from this forum till QNAP stop wasting volunteers' time. Get help from QNAP helpdesk instead.
Warning: offensive signature and materials damaging QNAP reputation follow:
QNAP's FW security issues
QNAP's hardware compatibility list madness
QNAP's new logo competition
Dear QNAP, kindly fire your clueless incompetent forum "admin" And while at it, don't forget the webmaster!
searcher1
New here
Posts: 2
Joined: Sun Dec 16, 2012 1:41 pm

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

Post by searcher1 »

Thank you, Doktornotor, if I buy another 2 x 4TB Hitachi's to match the ones I have would that suffice, or are they incompatible as the QNAP technicians are telling me. As far as I know I have replaced drives and they have handled the raid and all is well, so buying the other 2 should fix my problem? Cheers
User avatar
doktornotor
Ask me anything
Posts: 7472
Joined: Tue Apr 24, 2012 5:44 am

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

Post by doktornotor »

Well, since you already bought two and do not have problems with that. Still lot better than that Seagate chirp-and-click junk. :D
I'm gone from this forum till QNAP stop wasting volunteers' time. Get help from QNAP helpdesk instead.
Warning: offensive signature and materials damaging QNAP reputation follow:
QNAP's FW security issues
QNAP's hardware compatibility list madness
QNAP's new logo competition
Dear QNAP, kindly fire your clueless incompetent forum "admin" And while at it, don't forget the webmaster!
schwietert
New here
Posts: 2
Joined: Wed Jan 30, 2013 6:16 pm

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

Post by schwietert »

This worked perfect for me.
I run into the "TS-859 Pro+ crashing e2fsck_64" -Problem http://forum.qnap.com/viewtopic.php?p=216117#p215836 but solved it with a swapfile on an external usb-drive.

I started with four Seagate ST33000650NS 0004 drives as a raid5 system and I wanted to add two additional drives. The webinterface crashed after 50% so I had to use the command line. This howto saved my day.

Thank you!
Post Reply

Return to “System & Disk Volume Management”