Koozali.org: home of the SME Server

Expand Raid 1 disk?

Offline k_graham

  • ****
  • 146
  • +0/-0
Expand Raid 1 disk?
« 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

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Expand Raid 1 disk?
« Reply #1 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

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Expand Raid 1 disk?
« Reply #2 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"
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline k_graham

  • ****
  • 146
  • +0/-0
Re: Expand Raid 1 disk?
« Reply #3 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

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: Expand Raid 1 disk?
« Reply #4 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
« Last Edit: May 05, 2016, 11:10:07 PM by janet »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline k_graham

  • ****
  • 146
  • +0/-0
Re: Expand Raid 1 disk?
« Reply #5 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


Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Expand Raid 1 disk?
« Reply #6 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

Offline ReetP

  • *
  • 3,952
  • +6/-0
Re: Expand Raid 1 disk?
« Reply #7 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
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline allsorts

  • *
  • 38
  • +0/-0
Re: Expand Raid 1 disk?
« Reply #8 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 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-)
Cheers
Dave.

Offline k_graham

  • ****
  • 146
  • +0/-0
Re: Expand Raid 1 disk?
« Reply #9 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 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