Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Process to resize ext3 file system at the command line?
Date: Thu, 24 Nov 2011 09:01:02
Message-Id: 15c5cec2bec92b20de89bf88dc15ebe9.squirrel@www.antarean.org
In Reply to: Re: [gentoo-user] Process to resize ext3 file system at the command line? by Mark Knecht
1 On Fri, November 18, 2011 1:33 am, Mark Knecht wrote:
2 > On Thu, Nov 17, 2011 at 4:21 PM, Neil Bothwick <neil@××××××××××.uk> wrote:
3 >> On Thu, 17 Nov 2011 16:13:09 -0800, Mark Knecht wrote:
4 >>
5 >>> > Do you have separately partitioned drives with those partitions
6 >>> > arranged into single-partition arrays, or do you have one RAID device
7 >>> > that is then partitioned?
8 >>> >
9 >>> > If the latter, you should certainly work with the md device.
10 >>> >
11 >>> > I prefer to avoid all this confusion by creating a large, single
12 >>> > partition array that I use an an LVM physical volume.
13 >>>
14 >>> Separately partitioned drives arranged into RAID arrays.
15 >>
16 >> So you have three partitions arranged into a single RAID5 partition,
17 >> say /dev/md1?
18 >>
19 >> In that case, the size of /dev/md1 should already be correct and you
20 >> only
21 >> need to resize the filesystem and you should ignore my witterings about
22 >> fdisk that filed to take into account your use of RAID.
23 >> resize2fs /dev/md1 should be all you need, you shouldn't even need to
24 >> unmount the filesystem.
25 >>
26 >
27 > I have 3 partitions which were previously RAID-1. I've already failed
28 > one drive so at this moment it's a 2-drive RAID-1. I'm attempting to
29 > get those two remaining 2 partitions converted to RAID-5 the command
30 > suggested on the RAID list for doing that isn't working for me.
31 >
32 > Once the 250GB RAID-1 is converted to RAID-5 i have to add a new drive
33 > back in to become a 3-drive RAID-5. The drive I add will be the drive
34 > I just failed.
35 >
36 > c2stable ~ # mdadm --grow /dev/md6 --level=5
37 > mdadm: /dev/md6: could not set level to raid5
38 > c2stable ~ #
39 >
40 > c2stable ~ # mdadm -D /dev/md6
41 > /dev/md6:
42 > Version : 1.1
43 > Creation Time : Thu Apr 15 10:45:35 2010
44 > Raid Level : raid1
45 > Array Size : 247416933 (235.96 GiB 253.35 GB)
46 > Used Dev Size : 247416933 (235.96 GiB 253.35 GB)
47 > Raid Devices : 2
48 > Total Devices : 2
49 > Persistence : Superblock is persistent
50 >
51 > Update Time : Thu Nov 17 13:27:20 2011
52 > State : clean
53 > Active Devices : 2
54 > Working Devices : 2
55 > Failed Devices : 0
56 > Spare Devices : 0
57 >
58 > Name : c2stable:6 (local to host c2stable)
59 > UUID : 249c7331:a8203540:c8f3b020:fb30a66b
60 > Events : 1039
61 >
62 > Number Major Minor RaidDevice State
63 > 0 8 6 0 active sync /dev/sda6
64 > 1 8 22 1 active sync /dev/sdb6
65 > c2stable ~ #
66
67 I have never had to change a RAID-1 to RAID-5, but I would do it as follows:
68
69 1) Fail 2 drives from the RAID-1
70 2) Remove those 2 drives from the RAID-1
71 3) Create a new RAID-5 (with failed disk) using the 2 removed drives
72 4) Copy the data over from the RAID-1 to the RAID-5
73 5) Remove the RAID-1
74 6) Add the third drive to the RAID-5 and let it rebuild.
75
76 I don't know the commands for the above from memory, but I'm sure some of
77 this is in the man-page.
78
79 --
80 Joost
81
82 >
83 >
84 >