分类: LINUX
2011-05-23 08:31:48
[root@test ~]# mdadm /dev/md0 -f /dev/sdc1 mdadm: set /dev/sdc1 faulty in /dev/md0 |
[root@test ~]# mdadm /dev/md0 -r /dev/sdc1 mdadm: hot removed /dev/sdc1 from /dev/md0 |
[root@test ~]# cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] md0 : active raid5 sdd1[4] sdb1[0] sde1[3] 4190208 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]unused devices: |
[root@test ~]# mdadm /dev/md0 -a /dev/sdc1 mdadm: re-added /dev/sdc1 |
[root@test ~]# cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] md0 : active raid5 sdc1[1](S) sdd1[4] sdb1[0] sde1[3] 4190208 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]unused devices: |
[root@test ~]# mdadm /dev/md0 -a /dev/sdf1
mdadm: added /dev/sdf1
[root@test ~]# mdadm -D -s /dev/md0 /dev/md0: 1 8 33 - spare /dev/sdc1 |
mdadm --grow /dev/md0 --raid-disks=4 mdadm: Need to backup 3072K of critical section.. |
[root@test ~]# mdadm -D -s /dev/md0 /dev/md127: Version : 1.2 Creation Time : Thu May 19 20:55:31 2011 Raid Level : raid5 Array Size : 4190208 (4.00 GiB 4.29 GB) Used Dev Size : 2095104 (2046.34 MiB 2145.39 MB) Raid Devices : 4 Total Devices : 5 Persistence : Superblock is persistent Update Time : Thu May 19 21:29:45 2011 State : clean, recovering Active Devices : 4 Working Devices : 5 Failed Devices : 0 Spare Devices : 1 Layout : left-symmetric Chunk Size : 512K Reshape Status : 56% complete Delta Devices : 1, (3->4) Name : test:0 (local to host test) UUID : 628587c6:e00ecd89:62b64fe6:2c88ac63 Events : 65 Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 3 8 65 1 active sync /dev/sde1 4 8 49 2 active sync /dev/sdd1 5 8 81 3 active sync /dev/sdf1 1 8 33 - spare /dev/sdc1 |
[root@test ~]# pvresize /dev/md0 Physical volume "/dev/md0" changed |
[root@test ~]# pvdisplay /dev/md0 --- Physical volume --- PV Name /dev/md0 VG Name testvg PV Size 5.99 GiB / not usable 0 Allocatable yes PE Size 4.00 MiB Total PE 1534 Free PE 512 Allocated PE 1022 PV UUID eyudnw-heK0-Oce2-OYwz-qqZx-rZWh-00jBVN |
[root@test ~]# lvextend /dev/testvg/lvol0 -l +512 Extending logical volume lvol0 to 5.99 GiB Logical volume lvol0 successfully resized |
[root@test ~]# vgdisplay --- Volume group --- VG Name testvg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size 5.99 GiB PE Size 4.00 MiB Total PE 1534 Alloc PE / Size 1534 / 5.99 GiB Free PE / Size 0 / 0 VG UUID ShZwhx-qZ3J-GQMQ-FgRs-CnK3-hOzX-3SJMON |
[root@test ~]# resize2fs /dev/testvg/lvol0 resize2fs 1.41.12 (17-May-2010) Please run 'e2fsck -f /dev/testvg/lvol0' first. |
[root@test ~]# e2fsck -f /dev/testvg/lvol0 e2fsck 1.41.12 (17-May-2010) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/testvg/lvol0: 11/261632 files (0.0% non-contiguous), 34862/1046528 blocks |
[root@test ~]# resize2fs /dev/testvg/lvol0 resize2fs 1.41.12 (17-May-2010) Resizing the filesystem on /dev/testvg/lvol0 to 1570816 (4k) blocks. The filesystem on /dev/testvg/lvol0 is now 1570816 blocks long. |
[root@test ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 7.9G 1.8G 5.7G 24% / tmpfs 504M 0 504M 0% /dev/shm /dev/mapper/testvg-lvol0 5.9G 72M 5.6G 2% /data |