All of lore.kernel.org
 help / color / mirror / Atom feed
* How To Grow Using 'mdadm' Utility
@ 2010-01-27 18:56 Carlos Williams
  2010-01-27 23:29 ` Michał Sawicz
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Williams @ 2010-01-27 18:56 UTC (permalink / raw)
  To: linux-raid

I would like to know what is the proper syntax for creating / growing
my RAID5 array with 3 disks and 0 spare to 4 disks and 0 spare? Right
now my RAID5 array on my system appears as follows:

/dev/md0:
        Version : 0.90
  Creation Time : Wed Jan 27 08:15:03 2010
     Raid Level : raid5
     Array Size : 480391552 (458.14 GiB 491.92 GB)
  Used Dev Size : 240195776 (229.07 GiB 245.96 GB)
   Raid Devices : 3
  Total Devices : 3
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Wed Jan 27 13:47:49 2010
          State : clean, degraded, recovering
 Active Devices : 2
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 64K

 Rebuild Status : 10% complete

           UUID : e3c1e8b3:5a1b141f:af88d4a5:584f0b5f
         Events : 0.347

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2
       3       8       34        2      spare rebuilding   /dev/sdc2

I have an identical drive and want to make /dev/sdd2 a active member
of the RAID5 array which should expand my disk storage capacity.

I checked out the 'man' page for 'mdadm' utility and I think I am
wanting to use the 'mdadm --grow' command but I don't really know what
I am doing here and the man page is a nice reference but I am looking
for more guidance. Can anyone please tell me what is the proper way to
get my desired result?

*PS*
I understand right now my RAID5 is syncing and should probably wait
until all three drives are synced.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-27 18:56 How To Grow Using 'mdadm' Utility Carlos Williams
@ 2010-01-27 23:29 ` Michał Sawicz
  2010-01-28 14:58   ` Carlos Williams
  0 siblings, 1 reply; 10+ messages in thread
From: Michał Sawicz @ 2010-01-27 23:29 UTC (permalink / raw)
  To: Carlos Williams; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

Dnia 2010-01-27, śro o godzinie 13:56 -0500, Carlos Williams pisze:
> I checked out the 'man' page for 'mdadm' utility and I think I am
> wanting to use the 'mdadm --grow' command but I don't really know what
> I am doing here and the man page is a nice reference but I am looking
> for more guidance. Can anyone please tell me what is the proper way to
> get my desired result? 

See http://scotgate.org/2006/07/03/growing-a-raid5-array-mdadm/

You can check the status of your arrays by 'cat /proc/mdstat'.

-- 
Cheers
Michał (Saviq) Sawicz

[-- Attachment #2: To jest część wiadomości podpisana cyfrowo --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-27 23:29 ` Michał Sawicz
@ 2010-01-28 14:58   ` Carlos Williams
  2010-01-28 15:08     ` Michał Sawicz
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Williams @ 2010-01-28 14:58 UTC (permalink / raw)
  To: linux-raid

2010/1/27 Michał Sawicz <michal@sawicz.net>:
> See http://scotgate.org/2006/07/03/growing-a-raid5-array-mdadm/
>
> You can check the status of your arrays by 'cat /proc/mdstat'.

Thank you both for the links. The 1st one made me laugh...

I am not lazy as I did Google that but I wasn't sure about the last
two commands for expanding the file system and I didn't know how dated
that material was so I decided to ask here on the list.

Now my extra (4th disk) has been added and grown into my RAID5 array
as shown below:

[root@tuna ~]# mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Wed Jan 27 08:15:03 2010
     Raid Level : raid5
     Array Size : 720587328 (687.21 GiB 737.88 GB)
  Used Dev Size : 240195776 (229.07 GiB 245.96 GB)
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Thu Jan 28 08:35:24 2010
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : e3c1e8b3:5a1b141f:af88d4a5:584f0b5f
         Events : 0.1810

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2
       2       8       34        2      active sync   /dev/sdc2
       3       8       50        3      active sync   /dev/sdd2

Now my /dev/md0 RAID5 array is mounted to my / partition. I still need
to expand the file system to make use of the extra space, right? I
simply added the drive and empty partition table into the RAID...I
still don't have a file system on it yet, do I?
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-28 14:58   ` Carlos Williams
@ 2010-01-28 15:08     ` Michał Sawicz
  2010-01-28 15:13       ` Carlos Williams
  0 siblings, 1 reply; 10+ messages in thread
From: Michał Sawicz @ 2010-01-28 15:08 UTC (permalink / raw)
  To: Carlos Williams; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 539 bytes --]

Dnia 2010-01-28, czw o godzinie 09:58 -0500, Carlos Williams pisze:
> Now my /dev/md0 RAID5 array is mounted to my / partition. I still need
> to expand the file system to make use of the extra space, right? I
> simply added the drive and empty partition table into the RAID...I
> still don't have a file system on it yet, do I? 

Yes, that's what resize2fs will do for You (as long as it's ext[2-4]
we're talking about).

You need to 'fsck -f' first to verify that the filesystem is fine.

-- 
Cheers
Michał (Saviq) Sawicz

[-- Attachment #2: To jest część wiadomości podpisana cyfrowo --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-28 15:08     ` Michał Sawicz
@ 2010-01-28 15:13       ` Carlos Williams
  2010-01-28 15:23         ` Michał Sawicz
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Williams @ 2010-01-28 15:13 UTC (permalink / raw)
  To: linux-raid

2010/1/28 Michał Sawicz <michal@sawicz.net>:
> You need to 'fsck -f' first to verify that the filesystem is fine.

I get a stern warning that because /dev/md0 is my / (root) file
system, I can cause serious damage performing this task:

[root@tuna ~]# fsck -f
fsck from util-linux-ng 2.17
e2fsck 1.41.9 (22-Aug-2009)
/dev/md0 is mounted.

WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)?

*****************************************

Should I ignore the warning and proceed?
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-28 15:13       ` Carlos Williams
@ 2010-01-28 15:23         ` Michał Sawicz
  2010-01-28 15:50           ` Carlos Williams
  0 siblings, 1 reply; 10+ messages in thread
From: Michał Sawicz @ 2010-01-28 15:23 UTC (permalink / raw)
  To: Carlos Williams; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

Dnia 2010-01-28, czw o godzinie 10:13 -0500, Carlos Williams pisze:
> Should I ignore the warning and proceed?

If you do - remount the filesystem read-only (mount -o remount,ro). But
it would be best to use some LiveCD system, otherwise you will need to
resize on a live filesystem, it will take much more time and is more
dangerous than resizing offline.

If you can't take the fs offline - you can force resizing without fsck
first, but again - it would be best to fsck it and resize offline.

-- 
Cheers
Michał (Saviq) Sawicz

[-- Attachment #2: To jest część wiadomości podpisana cyfrowo --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-28 15:23         ` Michał Sawicz
@ 2010-01-28 15:50           ` Carlos Williams
  2010-01-28 15:59             ` Michał Sawicz
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Williams @ 2010-01-28 15:50 UTC (permalink / raw)
  To: linux-raid

2010/1/28 Michał Sawicz <michal@sawicz.net>:
> If you do - remount the filesystem read-only (mount -o remount,ro). But
> it would be best to use some LiveCD system, otherwise you will need to
> resize on a live filesystem, it will take much more time and is more
> dangerous than resizing offline.
>
> If you can't take the fs offline - you can force resizing without fsck
> first, but again - it would be best to fsck it and resize offline.

I can do "shutdown -r -F now" from my regular system. During this
reboot a fsck will be forced. Will that be enough?
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-28 15:50           ` Carlos Williams
@ 2010-01-28 15:59             ` Michał Sawicz
  2010-01-28 16:05               ` Carlos Williams
  0 siblings, 1 reply; 10+ messages in thread
From: Michał Sawicz @ 2010-01-28 15:59 UTC (permalink / raw)
  To: Carlos Williams; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

Dnia 2010-01-28, czw o godzinie 10:50 -0500, Carlos Williams pisze:
> I can do "shutdown -r -F now" from my regular system. During this
> reboot a fsck will be forced. Will that be enough? 

You would still need resize2fs to run on a running, mounted FS - it's
slow and smells of trouble.

-- 
Pozdrawiam
Michał (Saviq) Sawicz

[-- Attachment #2: To jest część wiadomości podpisana cyfrowo --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-28 15:59             ` Michał Sawicz
@ 2010-01-28 16:05               ` Carlos Williams
  2010-01-28 16:18                 ` Robin Hill
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Williams @ 2010-01-28 16:05 UTC (permalink / raw)
  To: linux-raid

2010/1/28 Michał Sawicz <michal@sawicz.net>:
> You would still need resize2fs to run on a running, mounted FS - it's
> slow and smells of trouble.

Thanks all. Last question. If I have my system as 3 disks in RAID5
array and the 4th disk as a hot spare. Do I still need to format the
4th disk with a filesystem (ext4)? Or will that occur when the
software discovers a disaster in the RAID volume and then starts to
sync the 'hot spare' into the degraded array to take the place of the
failed drive?

The 4th disk does have a 'fd' (RAID) partition table created but no
file system. Just trying to understand how that would work...
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How To Grow Using 'mdadm' Utility
  2010-01-28 16:05               ` Carlos Williams
@ 2010-01-28 16:18                 ` Robin Hill
  0 siblings, 0 replies; 10+ messages in thread
From: Robin Hill @ 2010-01-28 16:18 UTC (permalink / raw)
  To: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

On Thu Jan 28, 2010 at 11:05:33AM -0500, Carlos Williams wrote:

> Thanks all. Last question. If I have my system as 3 disks in RAID5
> array and the 4th disk as a hot spare. Do I still need to format the
> 4th disk with a filesystem (ext4)? Or will that occur when the
> software discovers a disaster in the RAID volume and then starts to
> sync the 'hot spare' into the degraded array to take the place of the
> failed drive?
> 
> The 4th disk does have a 'fd' (RAID) partition table created but no
> file system. Just trying to understand how that would work...
> 
No, you don't need a filesystem.  The recovery process will use the data
on the remaining disks to calculate what data was on the failed drive,
and write that to the spare.  This data will include the filesystem (or
parts thereof).

Cheers,
    Robin
-- 
     ___        
    ( ' }     |       Robin Hill        <robin@robinhill.me.uk> |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-01-28 16:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-27 18:56 How To Grow Using 'mdadm' Utility Carlos Williams
2010-01-27 23:29 ` Michał Sawicz
2010-01-28 14:58   ` Carlos Williams
2010-01-28 15:08     ` Michał Sawicz
2010-01-28 15:13       ` Carlos Williams
2010-01-28 15:23         ` Michał Sawicz
2010-01-28 15:50           ` Carlos Williams
2010-01-28 15:59             ` Michał Sawicz
2010-01-28 16:05               ` Carlos Williams
2010-01-28 16:18                 ` Robin Hill

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.