RAID1 to single disk

Questions about SNMP, Power, System, Logs, disk, & RAID.
ganekogorta
Getting the hang of things
Posts: 50
Joined: Sat Nov 21, 2009 7:31 am
Location: Bizkaia

RAID1 to single disk

Post by ganekogorta »

Hi

I'm interested in removing a disk from a two-disk RAID1. But I want the system not to be with the raid failure notice.
I want it to become a single-disk RAID1 volume.
Can it be done?

I think the key is to edit the /mnt/HDA_ROOT/.config/raid.conf file (or /etc/config/raid.conf). I don't want to edit it without being sure :shock:

Thanks and regards from Spain.
User avatar
MrVideo
Experience counts
Posts: 4742
Joined: Fri May 03, 2013 2:26 pm

Re: RAID1 to single disk

Post by MrVideo »

Nope, no can do. Why would you want to? If your single HDD fails, you've lost it all.
QTS MANUALS
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
Asking a question, include the following
(Thanks to Toxic17)
QNAP md_checker nasreport (release 20210309)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.5.2 Build 20210202 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos | My 2019 N. Ireland Game of Thrones tour
ganekogorta
Getting the hang of things
Posts: 50
Joined: Sat Nov 21, 2009 7:31 am
Location: Bizkaia

Re: RAID1 to single disk

Post by ganekogorta »

MrVideo wrote:Nope, no can do. Why would you want to? If your single HDD fails, you've lost it all.
Hi
If I want to change/upgrade one disk that contains system to a bigger disk.

For example: initial TS219 with one 2TB disk and final TS219 with one 6TB disk.
Mi idea is introduce the 6TB, build a raid1, extract the 2TB disk, “downgrade” the raid1 to single disk and expand the volume from 2 to 6 TB


Un saludo
Agur eta ondo ibili
Last edited by ganekogorta on Fri Nov 01, 2019 3:35 pm, edited 1 time in total.
User avatar
OneCD
Guru
Posts: 12037
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: RAID1 to single disk

Post by OneCD »

ganekogorta wrote: Sun Sep 15, 2019 7:05 am ... “downgrade” the raid1 to single disk ....
This part isn't supported by QTS. So, it's not possible to "downgrade" an array.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
User avatar
MrVideo
Experience counts
Posts: 4742
Joined: Fri May 03, 2013 2:26 pm

Re: RAID1 to single disk

Post by MrVideo »

Both HDDs must be replaced with the replace one-by-one option (in the manual).
QTS MANUALS
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
Asking a question, include the following
(Thanks to Toxic17)
QNAP md_checker nasreport (release 20210309)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.5.2 Build 20210202 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos | My 2019 N. Ireland Game of Thrones tour
ganekogorta
Getting the hang of things
Posts: 50
Joined: Sat Nov 21, 2009 7:31 am
Location: Bizkaia

RAID1 to single disk

Post by ganekogorta »

MrVideo wrote:Both HDDs must be replaced with the replace one-by-one option (in the manual).
No, the idea is begining with one drive, build raid1 with a second drive, retire the first drive and “dowgrade” raid1 to single drive (the second).

I think that is possible with the correct edition of raid.conf Image


Un saludo
Agur eta ondo ibili
User avatar
MrVideo
Experience counts
Posts: 4742
Joined: Fri May 03, 2013 2:26 pm

Re: RAID1 to single disk

Post by MrVideo »

ganekogorta wrote: Mon Sep 16, 2019 3:09 pmNo, the idea is begining with one drive, build raid1 with a second drive, retire the first drive and “dowgrade” raid1 to single drive (the second).
That is not what your wrote in your original post.
I think that is possible with the correct edition of raid.conf Image
No it is not. QNAP does not support RAID sizes reductions. You go to RAID1, you gotta stay with it, or increase to RAID5 or RAID6.
QTS MANUALS
Submit QNAP Support Ticket - QNAP Tutorials, FAQs, Downloads, Wiki - Product Support Status - Moogle's QNAP FAQ help V2
Asking a question, include the following
(Thanks to Toxic17)
QNAP md_checker nasreport (release 20210309)
===============================
Model: TS-869L -- RAM: 3G -- FW: QTS 4.1.4 Build 20150522 (used for data storage)
WD60EFRX-68L0BN1(x1)/68MYMN1(x7) Red HDDs -- RAID6: 8x6TB -- Cold spare: 1x6TB
Entware
===============================
Model: TS-451A -- RAM: 2G -- FW: QTS 4.5.2 Build 20210202 (used as a video server)
WL3000GSA6472(x3) White label NAS HDDs -- RAID5: 3x3TB
Entware -- MyKodi 17.3 (default is Kodi 16)
===============================
My 2017 Total Solar Eclipse Photos | My 2019 N. Ireland Game of Thrones tour
ganekogorta
Getting the hang of things
Posts: 50
Joined: Sat Nov 21, 2009 7:31 am
Location: Bizkaia

Re: RAID1 to single disk

Post by ganekogorta »

Hi

There is a solution that i wrote on qnapclub.es.

But it is in spanish (my language) . I hope that i’ll traslate it next weekend

https://www.qnapclub.es/showthread.php?tid=3139

I know that is unsupported by qnap but it’s a valid solution
User avatar
storageman
Ask me anything
Posts: 5507
Joined: Thu Sep 22, 2011 10:57 pm

Re: RAID1 to single disk

Post by storageman »

ganekogorta wrote: Wed Oct 23, 2019 10:13 pm Hi

There is a solution that i wrote on qnapclub.es.

But it is in spanish (my language) . I hope that i’ll traslate it next weekend

https://www.qnapclub.es/showthread.php?tid=3139

I know that is unsupported by qnap but it’s a valid solution
And you think this is something to recommend? Seriously???
ganekogorta
Getting the hang of things
Posts: 50
Joined: Sat Nov 21, 2009 7:31 am
Location: Bizkaia

Re: RAID1 to single disk

Post by ganekogorta »

storageman wrote:
ganekogorta wrote: Wed Oct 23, 2019 10:13 pm Hi

There is a solution that i wrote on qnapclub.es.

But it is in spanish (my language) . I hope that i’ll traslate it next weekend

https://www.qnapclub.es/showthread.php?tid=3139

I know that is unsupported by qnap but it’s a valid solution
And you think this is something to recommend? Seriously???
In case with two slots and one disk with problem, yes. Not everybody wants to use RAID1.

In case with a nas with two slots and you are using two single disks. When you want to change the system disk to a larger or new one... it’s useful


Un saludo
Agur eta ondo ibili
User avatar
storageman
Ask me anything
Posts: 5507
Joined: Thu Sep 22, 2011 10:57 pm

Re: RAID1 to single disk

Post by storageman »

ganekogorta wrote: Wed Oct 23, 2019 10:53 pm
storageman wrote:
ganekogorta wrote: Wed Oct 23, 2019 10:13 pm Hi

There is a solution that i wrote on qnapclub.es.

But it is in spanish (my language) . I hope that i’ll traslate it next weekend

https://www.qnapclub.es/showthread.php?tid=3139

I know that is unsupported by qnap but it’s a valid solution
And you think this is something to recommend? Seriously???
In case with two slots and one disk with problem, yes. Not everybody wants to use RAID1.

In case with a nas with two slots and you are using two single disks. When you want to change the system disk to a larger or new one... it’s useful


Un saludo
Agur eta ondo ibili
Perhaps you could explain what is a system disk. What do you mean?
ganekogorta
Getting the hang of things
Posts: 50
Joined: Sat Nov 21, 2009 7:31 am
Location: Bizkaia

Re: RAID1 to single disk

Post by ganekogorta »

i want to say a system volume.
One disk with one Storage pool.
In the Storage pool there is volume (system)

Sorry,my english is terrible Image

Image

In fact, there are 5 partitions in each disk. Our data is in the third partition.


Un saludo
Agur eta ondo ibili
mlbarnes
Starting out
Posts: 40
Joined: Fri Nov 20, 2015 4:07 pm

Re: RAID1 to single disk

Post by mlbarnes »

I would be interested to see the translation - I think it should be posted with a warning for sure (stating high risk of data loss, backups must be made!), but this sort of stuff is useful nonetheless.
The QNAP structure is often too inflexible, and nobody wants to offer anything like this, but I think we should, even if only to discuss and say OMG, I lost everything etc!
ganekogorta
Getting the hang of things
Posts: 50
Joined: Sat Nov 21, 2009 7:31 am
Location: Bizkaia

RAID1 to single disk

Post by ganekogorta »

Hi

I'll try to explain how to undo a raid 1 of TWO disks to ONE only.
It is even valid if it contains system volume. In fact this is the most interesting thing, especially for those who only have two bays in the QNAP.

This may be interesting for the following cases:
  • I have a disk with SMART crash warnings, I buy one same size, expand to RAID1 and remove it by removing the "touched" disk
  • I have a RAID1 and I want to undo it to reuse a disk because I need space or to mount it as a single drive.
We're going to need access to the console. I use WinSCP and Putty.
My Qnap is a TS469Pro with QTS 4.3.4

Just in case I recommend a data backup, as a failure can cost us to lose everything :!:
  • 1- We start from a single disk, create a raid1 and remove the old disk
This case is the easiest since we are going to take advantage of a file that we already have.
Initially I have a disk in bay1 (the first) as a simple disk. It's size is 160GB and it's serial number is 5RX0XIJN
Image

Image

Image

We examine and save the contents of the /etc/config/raid.conf file (which is actually located in /mnt/HDA_ROOT/.config/raid.conf)

Code: Select all

[Global]
raidBitmap = 0x2
pd_5RX0XIJN_Raid_Bitmap = 0x2

[RAID_1]
uuid = adcdd09b:1286b132:793faae3:09f1257a
id = 1
partNo = 3
aggreMember = no
readonly = no
legacy = no
version2 = yes
deviceName = /dev/md1
raidLevel = 1
internal = 1
mdBitmap = 0
chunkSize = 64
readAhead = 0
stripeCacheSize = 0
speedLimitMax = 0
speedLimitMin = 0
data_0 = 1, 5RX0XIJN
dataBitmap = 1
Raid1 construction

Now we physically add in the second bay the "new" 160GB disk and serial number 5RX0XHMS.
The nas will let us know that it has detected it by beeping and will prepare the disc.
Remember that if that disk has something it will erase it without asking (as long as they are not previous QNAP partitions).

Image

From the menus, migrate from single disk to RAID1

Image

Image

We finish the wizard and wait for both disks to be synchronized (be patience if you have large disks)
Image

When it's finished we'll be with something similar to this
Image

Now again we get the contents of the new /etc/config/raid.conf file

Code: Select all

[Global]
raidBitmap = 0x2
pd_5RX0XIJN_Raid_Bitmap = 0x2
pd_5RX0XHMS_Raid_Bitmap = 0x2

[RAID_1]
uuid = adcdd09b:1286b132:793faae3:09f1257a
id = 1
partNo = 3
aggreMember = no
readonly = no
legacy = no
version2 = yes
deviceName = /dev/md1
raidLevel = 1
internal = 1
mdBitmap = 0
chunkSize = 0
readAhead = 4096
stripeCacheSize = 0
speedLimitMax = 0
speedLimitMin = 50000
data_0 = 1, 5RX0XIJN
data_1 = 2, 5RX0XHMS
dataBitmap = 3
scrubStatus = 1
eventSkipped = 0
eventCompleted = 1
degradedCnt = 0
These values have changed:
chunkSize = 0
readAhead = 4096
dataBitmap = 3

And these are the new lines:
pd_5RX0XHMS_Raid_Bitmap = 0x2
data_1 = 2, 5RX0XHMS
scrubStatus = 1
eventSkipped = 0
eventCompleted = 1
degradedCnt = 0

Now go to the console and using the mdadm command you can see the status and other information of the raid.
Run "mdadm --query --detail /dev/md1" where md1 is the first (and only) raid1 created on the nas.

Image

You see the correct size and status information for "clean". We also see in the lower lines the partitions involved in it.
On disk number 0 (bay 1) the partition is /dev/sda3
On disk number 1 (bay 2) the partition is the /dev/sdb3

Now we put the first disk into failure mode and extract the disk using two commands:
"mdadm /dev/md1 --fail /dev/sda3"
"mdadm /dev/md1 --remove /dev/sda3"

Image

The nas will beep and activate the red alarm LED. Now we can physically extract the disk from the first bay (the original)

If we go to the QTS environment we'll see the following

Image

We can also see it from the console with "mdadm --query --datail /dev/md1"
Image

I run the following command by console to reduce the number of raid members to a single member. I get a single-disc Raid1
"mdadm --grow /dev/md1 --raid-devices=1 --force"
Image

Now we need to edit the /etc/config/raid.conf file to look like this:

Code: Select all

[Global]
raidBitmap = 0x2
pd_5RX0XHMS_Raid_Bitmap = 0x2

[RAID_1]
uuid = adcdd09b:1286b132:793faae3:09f1257a
id = 1
partNo = 3
aggreMember = no
readonly = no
legacy = no
version2 = yes
deviceName = /dev/md1
raidLevel = 1
internal = 1
mdBitmap = 0
chunkSize = 64
readAhead = 0
stripeCacheSize = 0
speedLimitMax = 0
speedLimitMin = 50000
data_0 = 1, 5RX0XHMS
dataBitmap = 1


[Remove]
I've removed the lines that begin with "scrubstatus, eventskipped, eventcompleted,degradedcnt".
I've removed the line that starts with "data_0", and the one that starts with "data_1" I've modified it to "data_0 = 1, disk_serial_number"
I removed the lines from the [Remove] field
I've changed chunkSize from 64 to value 0
I've changed readAhead from 4096 to value 0
I've changed databitmap from 3 to value 1

We can be done faster if you take advantage of and edit the initial file (raid.conf) when there was a single disk, we would only have to update the serial number of the disk with the new one. :wink:

Once the change is saved, we turn off the nas via QTS or from the console with "halt".

When it's off, we move the disk from Bay 2 to Bay 1 and mission accomplished. :D

We started and we already have our new record with everything we had in the original.

If we go to the QTS environment we will see the following:

Image

And if we do it by console

Image

The disk that was in Bay 1 and we removed, contains EVERYTHING, nothing has been deleted.
If we want to use it on the nas again we must delete the five partitions.

I hope it will be useful for qnap nas owners with two bays who wants to change that disk.

P.D. If you see spelling errors, clemence with me :wink:

Regards from Spain
Last edited by ganekogorta on Fri Nov 01, 2019 5:56 pm, edited 1 time in total.
ja666
Know my way around
Posts: 186
Joined: Sat Nov 29, 2014 5:21 pm

Re: RAID1 to single disk

Post by ja666 »

ganekogorta wrote: Fri Nov 01, 2019 5:56 pmI'll try to explain how to undo a raid 1 of TWO disks to ONE only.
Great job done, THX!
I'm de-RAIDing my 2-bay QNAP slightly different way, will share when successful finishing.
Post Reply

Return to “System & Disk Volume Management”