* Need pointers to shrinking an array
@ 2011-09-18 14:50 Michał Sawicz
2011-09-18 23:17 ` NeilBrown
0 siblings, 1 reply; 2+ messages in thread
From: Michał Sawicz @ 2011-09-18 14:50 UTC (permalink / raw)
To: linux-raid
[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]
Hi again,
Given an array with --examine like so:
> /dev/sdf1:
> Magic : a92b4efc
> Version : 1.1
> Feature Map : 0x0
> Array UUID : 9ce41f94:7489a7f2:6897e4b5:269c8b3b
> Name : media:2 (local to host media)
> Creation Time : Sun Jan 24 22:32:58 2010
> Raid Level : raid6
> Raid Devices : 10
>
> Avail Dev Size : 1953519738 (931.51 GiB 1000.20 GB)
> Array Size : 15628156928 (7452.09 GiB 8001.62 GB)
> Used Dev Size : 1953519616 (931.51 GiB 1000.20 GB)
> Data Offset : 264 sectors
> Super Offset : 0 sectors
> State : clean
> Device UUID : 97945e4f:9f439aec:951cb289:47862ad7
>
> Update Time : Sun Sep 18 16:31:52 2011
> Checksum : 4da159ea - correct
> Events : 4381317
>
> Layout : left-symmetric
> Chunk Size : 256K
>
> Device Role : Active device 7
> Array State : AAAAAAAAAA ('A' == active, '.' == missing)
On it, a resized filesystem:
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/md2 1982282708 1970782580 11500128 100% /mnt/store.tmp
I now need to shrink the array to as few drives as possible. I know
`mdadm --grow --array-size=x` will let me check if the resulting FS is
still fine. Is x in Kibibytes, same as for --size? What's the best way
of determining x?
Then, a `mdadm --grow --raid-devices=y` will let me reduce the number of
drives used. Is there a way to tell _which_ drives are to be active and
which - spares in the resulting array?
Is there anything else I should know?
Regards,
--
Michał (Saviq) Sawicz <michal@sawicz.net>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Need pointers to shrinking an array
2011-09-18 14:50 Need pointers to shrinking an array Michał Sawicz
@ 2011-09-18 23:17 ` NeilBrown
0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2011-09-18 23:17 UTC (permalink / raw)
To: Michał Sawicz; +Cc: linux-raid
[-- Attachment #1: Type: text/plain, Size: 2494 bytes --]
On Sun, 18 Sep 2011 16:50:00 +0200 Michał Sawicz <michal@sawicz.net> wrote:
> Hi again,
>
> Given an array with --examine like so:
> > /dev/sdf1:
> > Magic : a92b4efc
> > Version : 1.1
> > Feature Map : 0x0
> > Array UUID : 9ce41f94:7489a7f2:6897e4b5:269c8b3b
> > Name : media:2 (local to host media)
> > Creation Time : Sun Jan 24 22:32:58 2010
> > Raid Level : raid6
> > Raid Devices : 10
> >
> > Avail Dev Size : 1953519738 (931.51 GiB 1000.20 GB)
> > Array Size : 15628156928 (7452.09 GiB 8001.62 GB)
> > Used Dev Size : 1953519616 (931.51 GiB 1000.20 GB)
> > Data Offset : 264 sectors
> > Super Offset : 0 sectors
> > State : clean
> > Device UUID : 97945e4f:9f439aec:951cb289:47862ad7
> >
> > Update Time : Sun Sep 18 16:31:52 2011
> > Checksum : 4da159ea - correct
> > Events : 4381317
> >
> > Layout : left-symmetric
> > Chunk Size : 256K
> >
> > Device Role : Active device 7
> > Array State : AAAAAAAAAA ('A' == active, '.' == missing)
>
> On it, a resized filesystem:
> > Filesystem 1K-blocks Used Available Use% Mounted on
> > /dev/md2 1982282708 1970782580 11500128 100% /mnt/store.tmp
>
> I now need to shrink the array to as few drives as possible. I know
> `mdadm --grow --array-size=x` will let me check if the resulting FS is
> still fine. Is x in Kibibytes, same as for --size? What's the best way
> of determining x?
Yes, x is in Kibibytes, though 'M' and 'G' suffixes are allowed for Mebibytes
and Gibibytes.
If you try the reshape without setting --array-size first, it will tell you
exactly what --array-size command you need to run.
>
> Then, a `mdadm --grow --raid-devices=y` will let me reduce the number of
> drives used. Is there a way to tell _which_ drives are to be active and
> which - spares in the resulting array?
It will use the first y devices. i.e. those with a "Device Role : Active
device N' number of 0..y-1.
>
> Is there anything else I should know?
backups are good.
loose cables are bad.
Testing on loop-back devices can help increase your confidence.
But you probably know that already.
The really important thing is to perform proper tests after the --array-size
change to ensure that your data is still all visible. And 'fsck' and a
'mount' should do that. But you seem to know that already too.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-18 23:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-18 14:50 Need pointers to shrinking an array Michał Sawicz
2011-09-18 23:17 ` NeilBrown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).