我正在尝试将第二个 SSD 添加到 Centos 6 系统。但我Error 5 partition table invalid or corrupt
在启动时遇到了这个问题。
系统已在 RAID 1 阵列中拥有单个 SSD (sdb) 和一对 HDD (sd{a,c}),系统从该阵列启动。就好像新的 SSD 假定为 RAID 阵列的设备之一。是吗?如何避免这种情况或重新安排设置?
# cat fstab
UUID=967b4035-782d-4c66-b22f-50244fe970ca / ext4 defaults 1 1
UUID=86fd06e9-cdc9-4166-ba9f-c237cfc43e02 /boot ext4 defaults 1 2
UUID=72552a7a-d8ae-4f0a-8917-b75a6239ce9f /ssd ext4 discard,relatime 1 2
UUID=8000e5e6-caa2-4765-94f8-9caeb2bda26e swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
# ll /dev/disk/by-id/
total 0
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX -> ../../sdb
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX-part1 -> ../../sdb1
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-ST3500413AS_5VMT49E3 -> ../../sdc
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part1 -> ../../sdc1
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part2 -> ../../sdc2
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMT49E3-part3 -> ../../sdc3
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ -> ../../sda
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part2 -> ../../sda2
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 ata-ST3500413AS_5VMTJNAJ-part3 -> ../../sda3
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:0 -> ../../md0
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:1 -> ../../md1
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-name-localhost.localdomain:2 -> ../../md2
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-a04d7241:8da6023e:f9004352:107a923a -> ../../md1
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-a22c43b9:f1954990:d3ddda5e:f9aff3c9 -> ../../md0
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 md-uuid-f403a2d0:447803b5:66edba73:569f8305 -> ../../md2
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX -> ../../sdb
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_OCZ-VERTEX3_OCZ-43DSRFTNCLE9ZJXX-part1 -> ../../sdb1
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3 -> ../../sdc
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part1 -> ../../sdc1
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part2 -> ../../sdc2
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMT49E3-part3 -> ../../sdc3
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ -> ../../sda
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part2 -> ../../sda2
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 scsi-SATA_ST3500413AS_5VMTJNAJ-part3 -> ../../sda3
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5000c500383621ff -> ../../sdc
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part1 -> ../../sdc1
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part2 -> ../../sdc2
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c500383621ff-part3 -> ../../sdc3
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5000c5003838b2e7 -> ../../sda
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part2 -> ../../sda2
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5000c5003838b2e7-part3 -> ../../sda3
lrwxrwxrwx. 1 root root 9 Jun 15 23:50 wwn-0x5e83a97f592139d6 -> ../../sdb
lrwxrwxrwx. 1 root root 10 Jun 15 23:50 wwn-0x5e83a97f592139d6-part1 -> ../../sdb1
# fdisk -l
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 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: 0x79298ec9
Device Boot Start End Blocks Id System
/dev/sdb1 1 14594 117219328 83 Linux
Disk /dev/sdc: 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: 0x000d99de
Device Boot Start End Blocks Id System
/dev/sdc1 1 1275 10240000 fd Linux raid autodetect
/dev/sdc2 * 1275 1339 512000 fd Linux raid autodetect
/dev/sdc3 1339 60802 477633536 fd Linux raid autodetect
Disk /dev/sda: 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: 0x000b3327
Device Boot Start End Blocks Id System
/dev/sda1 1 1275 10240000 fd Linux raid autodetect
/dev/sda2 * 1275 1339 512000 fd Linux raid autodetect
/dev/sda3 1339 60802 477633536 fd Linux raid autodetect
Disk /dev/md0: 10.5 GB, 10484641792 bytes
2 heads, 4 sectors/track, 2559727 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/md0 doesn't contain a valid partition table
Disk /dev/md2: 489.1 GB, 489095557120 bytes
2 heads, 4 sectors/track, 119408095 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/md2 doesn't contain a valid partition table
Disk /dev/md1: 524 MB, 524275712 bytes
2 heads, 4 sectors/track, 127997 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/md1 doesn't contain a valid partition table
# cat /etc/grub.conf
default=0
timeout=5
splashimage=(hd2,1)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-220.17.1.el6.x86_64)
root (hd2,1)
kernel /vmlinuz-2.6.32-220.17.1.el6.x86_64 ro root=UUID=967b4035-782d-4c66-b22f-50244fe970ca rd_MD_UUID=f403a2d0:447803b5:66edba73:569f8305 rd_MD_UUID=a22c43b9:f1954990:d3ddda5e:f9aff3c9 rd_NO_LUKS rd_NO_LVM rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=br-abnt2 crashkernel=auto rhgb quiet
initrd /initramfs-2.6.32-220.17.1.el6.x86_64.img
答案1
我无法直接修复它,因此我拿出新的 SSD 并将其安装在我的桌面上,然后对其进行分区和格式化。
然后在服务器中我编辑了fstab
对旧 SSD 行的注释并添加了一个具有通用设备规格的新行:
#UUID=72552a7a-d8ae-4f0a-8917-b75a6239ce9f /ssd ext4 discard,relatime 1 2
/dev/sdb1 /ssd ext4 discard,relatime 1 2
然后我关闭了服务器,并将旧的 SSD 换成了新的。
重新启动后,我编辑了相应 UUID 的设备规格:
$ ll /dev/disk/by-uuid/
total 0
lrwxrwxrwx. 1 root root 10 Jun 16 14:02 14a9f494-4cba-4afe-b90e-82f3f131097f -> ../../sdb1
lrwxrwxrwx. 1 root root 9 Jun 16 14:02 8000e5e6-caa2-4765-94f8-9caeb2bda26e -> ../../md0
lrwxrwxrwx. 1 root root 9 Jun 16 14:02 86fd06e9-cdc9-4166-ba9f-c237cfc43e02 -> ../../md1
lrwxrwxrwx. 1 root root 9 Jun 16 14:02 967b4035-782d-4c66-b22f-50244fe970ca -> ../../md2
新的fstab
:
#UUID=72552a7a-d8ae-4f0a-8917-b75a6239ce9f /ssd ext4 discard,relatime 1 2
UUID=14a9f494-4cba-4afe-b90e-82f3f131097f /ssd ext4 discard,relatime 1 2
重新引导一次就完成了。