我正在运行Ubuntu 11.04(内核2.6.38-11)。我用2x500GB驱动器替换了2x160GB。它们被配置为RAID1。
分区表显示正确的大小。这是sfdisk:
# sfdisk -d /dev/sdb
# partition table of /dev/sdb
unit: sectors
/dev/sdb1 : start= 63, size= 192717, Id=fd, bootable
/dev/sdb2 : start= 192780, size= 7807590, Id=fd
/dev/sdb3 : start= 8000370, size=968767695, Id=fd
/dev/sdb4 : start= 0, size= 0, Id= 0
和fdisk:
# fdisk -l /dev/sdb
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006c78f
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 12 96358+ fd Linux raid autodetect
/dev/sdb2 13 498 3903795 fd Linux raid autodetect
/dev/sdb3 499 60801 484383847+ fd Linux raid autodetect
但是我没有看到新的空间:
root@green:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md2 143G 134G 8.3G 95% /
root@green:~# mdadm --examine /dev/sdb3
/dev/sdb3:
Magic : a92b4efc
Version : 0.90.00
UUID : b8f83980:f60d820c:74c46fbf:0baa68bc
Creation Time : Sun Mar 29 18:48:46 2009
Raid Level : raid1
Used Dev Size : 152247936 (145.19 GiB 155.90 GB)
Array Size : 152247936 (145.19 GiB 155.90 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 2
Update Time : Mon Oct 10 19:22:36 2011
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Checksum : 7b5debb7 - correct
Events : 10729526
Number Major Minor RaidDevice State
this 0 8 19 0 active sync /dev/sdb3
0 0 8 19 0 active sync /dev/sdb3
1 1 8 3 1 active sync /dev/sda3
我尝试了mdadm和resize2fs:
# mdadm --grow /dev/md2 --size=max
mdadm: component size of /dev/md2 has been set to 152247936K
# resize2fs /dev/md2
resize2fs 1.41.14 (22-Dec-2010)
The filesystem is already 38061984 blocks long. Nothing to do!
有任何想法吗?
根据要求添加
# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 sdb3[0] sda3[1]
152247936 blocks [2/2] [UU]
md0 : active raid1 sdb1[0] sda1[1]
96256 blocks [2/2] [UU]
md1 : active raid1 sdb2[0] sda2[1]
3903680 blocks [2/2] [UU]
unused devices: <none>
隔断
# cat /proc/partitions
major minor #blocks name
8 0 488386584 sda
8 1 96358 sda1
8 2 3903795 sda2
8 3 152248005 sda3
8 16 488386584 sdb
8 17 96358 sdb1
8 18 3903795 sdb2
8 19 152248005 sdb3
9 1 3903680 md1
9 0 96256 md0
9 2 152247936 md2
分手:
# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all
Model: ATA WDC WD5000AAKX-0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 98.7MB 98.7MB primary ext3 boot, raid
2 98.7MB 4096MB 3997MB primary linux-swap(v1) raid
3 4096MB 500GB 496GB primary ext3 raid
Model: ATA WDC WD5000AAKS-4 (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 98.7MB 98.7MB primary ext3 boot, raid
2 98.7MB 4096MB 3997MB primary linux-swap(v1) raid
3 4096MB 500GB 496GB primary ext3 raid
Model: Linux Software RAID Array (md)
Disk /dev/md1: 3997MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 3997MB 3997MB linux-swap(v1)
Model: Linux Software RAID Array (md)
Disk /dev/md0: 98.6MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 98.6MB 98.6MB ext3
Model: Linux Software RAID Array (md)
Disk /dev/md2: 156GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 156GB 156GB ext3
通过电子邮件发表评论:
问题出在元数据中,您只需要使用参数--update devicesize组装raid数组即可
然后-G / dev / md?-z max将完成工作:)
sfdisk
您说(?)…是指您也复制了磁盘分区架构吗?
cat /proc/mdstat
什么?怎么cat /proc/partitions
样