Koozali.org: home of the SME Server

Obsolete Releases => SME Server 9.x => Topic started by: k_graham on May 03, 2016, 07:46:25 AM

Title: Expand Raid 1 disk?
Post by: k_graham on May 03, 2016, 07:46:25 AM
1. I've mirrored a 2 Terabyte disk with a 1 Terabyte disk.
2. I would like to remove the 1 Terabyte disk then expand the 2 terabyte  to take all space and don't see the procedure for Raid 1?

3. After which I would install a 2nd 2 terabyte drive and have it Mirror.

If anyone could point me to Step 2 for Raid 1?

Thanks,

Ken
Title: Re: Expand Raid 1 disk?
Post by: Stefano on May 03, 2016, 07:57:11 AM
Remove the smaller, add the new disk, let the raid sync
Have a look at Raid page in the wiki
Title: Re: Expand Raid 1 disk?
Post by: janet on May 03, 2016, 08:20:26 PM
k_graham

Quote
2. I would like to remove the 1 Terabyte disk then expand the 2 terabyte  to take all space and don't see the procedure for Raid 1?
3. After which I would install a 2nd 2 terabyte drive and have it Mirror.

Just to remind you & add to Staefanos words, the procedure is to add the second drive first, let it sync as a 1Tb array, then expand the size as per wiki.
see
https://wiki.contribs.org/Raid

& particularly this section
https://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size

noting the words
"Note: these instructions are only applicable if you have a RAID system with more than one drive. They are not applicable to a single-drive RAID 1 system, and increasing the useable space on such a system by cloning the existing single drive to a larger drive is not supported. See http://bugs.contribs.org/show_bug.cgi?id=5311"
Title: Re: Expand Raid 1 disk?
Post by: k_graham on May 05, 2016, 07:28:51 PM
Greetings Stephano and Janet;

Okay, I did add the 2nd 2 terabyte SATA drive and had it fully sync.

[root@cphome ~]# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[3] sda1[2]                           (this is a WD Black 2 TB drive)
      255936 blocks super 1.0 [2/2] [UU]

md1 : active raid1 sdb2[3] sda2[2]                            (this is a Hitachi 2 TB drive)
      976373568 blocks super 1.1 [2/2] [UU]
      bitmap: 2/8 pages [8KB], 65536KB chunk

unused devices: <none>

I confirmed by swapping SATA cables and it boots either way.

I am however having trouble with the resize

The info suggests this
resize2fs /dev/md2 &       as their is no md2


I tried the following 3 with the results shown

[root@cphome ~]# resize2fs /dev/md2 &
[1] 3233
[root@cphome ~]# resize2fs 1.41.12 (17-May-2010)
open: No such file or directory while opening /dev/md2

[root@cphome ~]# resize2fs /dev/md1 &
[1] 3239
[root@cphome ~]# resize2fs 1.41.12 (17-May-2010)
resize2fs: Device or resource busy while trying to open /dev/md1
Couldn't find valid filesystem superblock.

[1]+  Exit 1                  resize2fs /dev/md1



[root@cphome ~]#
[root@cphome ~]# resize2fs /dev/md0 &
[1] 3247
[root@cphome ~]# resize2fs 1.41.12 (17-May-2010)
The filesystem is already 255936 blocks long.  Nothing to do!

So I am at a bit of a loss as to resizing?

Thanks for any input.

Ken
Title: Re: Expand Raid 1 disk?
Post by: janet on May 05, 2016, 11:03:52 PM
k_graham

md0 & md1 are split across both drives, they are not individual drives

md0 will be your boot area, so usually does not need resizing
md1 will be your data area, so that is the area to resize

as you only have a md0 & md1 then you need to modify the commands accordingly

ie from the wiki it says (modified for your md1)
mdadm --grow /dev/md1 --size=max
pvresize /dev/md1
lvresize -l +100%FREE main/root
ext2online -C0 /dev/main/root

In the last command above, the -C0 is: dash C zero
Title: Re: Expand Raid 1 disk?
Post by: k_graham on May 16, 2016, 04:21:58 AM
k_graham

md0 & md1 are split across both drives, they are not individual drives

md0 will be your boot area, so usually does not need resizing
md1 will be your data area, so that is the area to resize

as you only have a md0 & md1 then you need to modify the commands accordingly

ie from the wiki it says (modified for your md1)
mdadm --grow /dev/md1 --size=max
pvresize /dev/md1
lvresize -l +100%FREE main/root
ext2online -C0 /dev/main/root

In the last command above, the -C0 is: dash C zero

Thank you Janet, with the exception line 4 gave a
# ext2online -C0 /dev/main/root
-bash: ext2online: command not found

 I had to change line 4 to the other line noted
resize2fs /dev/md2 &

Though now its been a few days , I'm thinking it might have been
  resize2fs /dev/md1 &    as I'm pretty sure I had tried the above resize earlier.

I know I had asked this in the 8 forum, but in actual fact this computer was running SME 9 if that could be where the difference is?

Anyway thanks.

Ken

Title: Re: Expand Raid 1 disk?
Post by: Stefano on May 16, 2016, 09:55:50 AM
Quote
but in actual fact this computer was running SME 9 if that could be where the difference is?

well, yes..

moving to SME9
Title: Re: Expand Raid 1 disk?
Post by: ReetP on May 16, 2016, 11:08:19 AM
From the looks of it you have two md devices (as opposed to drives)
md0 - boot partition
md1 - main data partition

Check with /proc/mdstat

You have no md2.....

Read though here https://wiki.contribs.org/Raid:Growing
Title: Re: Expand Raid 1 disk?
Post by: allsorts on May 26, 2016, 11:51:08 AM
From the looks of it you have two md devices (as opposed to drives)
md0 - boot partition
md1 - main data partition

Check with /proc/mdstat

You have no md2.....

Read though here https://wiki.contribs.org/Raid:Growing

Raid:Growing is really about adding extra discs to the array not just swapping discs for larger ones.

I've just been through the changing to bigger drives loop. The https://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size (https://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size) is correct apart from, for an SME9 system, using md2 not md1 and not really saying what "Boot up and manage raid to add new (larger) drive to system." means ie login to the admin console and use option 5. I have wiki write access so that will change...

Other than that it's a painless, if time consuming waiting for the syncs to complete, operation.

k_graham have a close look at your resize2fs parameter.  B-)
Title: Re: Expand Raid 1 disk?
Post by: k_graham on October 10, 2016, 04:49:59 AM
Raid:Growing is really about adding extra discs to the array not just swapping discs for larger ones.

I've just been through the changing to bigger drives loop. The https://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size (https://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size) is correct apart from, for an SME9 system, using md2 not md1 and not really saying what "Boot up and manage raid to add new (larger) drive to system." means ie login to the admin console and use option 5. I have wiki write access so that will change...

Other than that it's a painless, if time consuming waiting for the syncs to complete, operation.

k_graham have a close look at your resize2fs parameter.  B-)

I think you added this to the wiki since I first looked

     resize2fs /dev/mapper/main-root &

That did it and it is currently performing a resize on this SME 9 system. 
Thanks
Ken Graham