Ok, I give up... I have to ask. This is CentOS 5.
I switched one of my raid1 disks, and I already thought I had succeeded. But now it seems that something is very wrong with the first partition on the new disk. Luckily my system is fully bootable with the other disk.
Here's some info. The new disk is sdb.
// I removed all partitions with parted, and created the first one again. // parted does not complain:
[root@mail dev]# parted sdb Using /dev/sdb (parted) print
Model: ATA SAMSUNG HD321KJ (scsi) Disk /dev/sdb: 320GB Sector size (logical/physical): 512B/512B Partition Table: msdos
Number Start End Size Type File system Flags 1 0.51kB 101MB 101MB primary ext2
(parted) rm 1 (parted) mkpart primary 1 100 (parted) print
Model: ATA SAMSUNG HD321KJ (scsi) Disk /dev/sdb: 320GB Sector size (logical/physical): 512B/512B Partition Table: msdos
Number Start End Size Type File system Flags 1 0.51kB 100MB 100MB primary ext2
(parted) quit
// If I try to create a file system on the new partition, // I get an error message:
[root@mail dev]# mkfs ext3 sdb1 mke2fs 1.39 (29-May-2006) mkfs.ext2: invalid blocks count - sdb1
// I cannot create a volume label: [root@mail dev]# e2label sdb1 /mnt/mirror [root@mail dev]# e2label sdb1
[root@mail dev]#
//fsck informs me like this:
[root@mail dev]# e2fsck sdb1 e2fsck 1.39 (29-May-2006) The filesystem size (according to the superblock) is 77392578 blocks The physical size of the device is 24414 blocks Either the superblock or the partition table is likely to be corrupt! Abort<y>? yes
// I even tried fsck using the secondary (or tertiary) superblock // but no success.
So now what? Apart from doing a low-level format.
- Jussi
-- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) jussi.hirvi@greenspot.fi * http://www.greenspot.fi
I think I solved it by this simple command: mke2fs -S /dev/sdb1 ...which only rewrites the superblock.
This *wrong* command might have spoiled the partition (there should be -T before ext3):
[root@mail dev]# mkfs ext3 sdb1 mke2fs 1.39 (29-May-2006) mkfs.ext2: invalid blocks count - sdb1
- Jussi
Jussi Hirvi (greenspot@greenspot.fi) kirjoitteli (15.8.2008 17:45):
Ok, I give up... I have to ask. This is CentOS 5.
I switched one of my raid1 disks, and I already thought I had succeeded. But now it seems that something is very wrong with the first partition on the new disk. Luckily my system is fully bootable with the other disk.
Here's some info. The new disk is sdb.
// I removed all partitions with parted, and created the first one again. // parted does not complain:
[root@mail dev]# parted sdb Using /dev/sdb (parted) print
Model: ATA SAMSUNG HD321KJ (scsi) Disk /dev/sdb: 320GB Sector size (logical/physical): 512B/512B Partition Table: msdos
Number Start End Size Type File system Flags 1 0.51kB 101MB 101MB primary ext2
(parted) rm 1 (parted) mkpart primary 1 100 (parted) print
Model: ATA SAMSUNG HD321KJ (scsi) Disk /dev/sdb: 320GB Sector size (logical/physical): 512B/512B Partition Table: msdos
Number Start End Size Type File system Flags 1 0.51kB 100MB 100MB primary ext2
(parted) quit
// If I try to create a file system on the new partition, // I get an error message:
[root@mail dev]# mkfs ext3 sdb1 mke2fs 1.39 (29-May-2006) mkfs.ext2: invalid blocks count - sdb1
// I cannot create a volume label: [root@mail dev]# e2label sdb1 /mnt/mirror [root@mail dev]# e2label sdb1
[root@mail dev]#
//fsck informs me like this:
[root@mail dev]# e2fsck sdb1 e2fsck 1.39 (29-May-2006) The filesystem size (according to the superblock) is 77392578 blocks The physical size of the device is 24414 blocks Either the superblock or the partition table is likely to be corrupt! Abort<y>? yes
// I even tried fsck using the secondary (or tertiary) superblock // but no success.
So now what? Apart from doing a low-level format.
- Jussi
-- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) jussi.hirvi@greenspot.fi * http://www.greenspot.fi
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) jussi.hirvi@greenspot.fi * http://www.greenspot.fi
Jussi Hirvi wrote:
I think I solved it by this simple command: mke2fs -S /dev/sdb1 ...which only rewrites the superblock.
I would have just used fdisk instead of partd. If you are adding this to a raid, you don't need a filesystem, just a partition of the right size. The contents are going to be wiped by the raid sync anyway.
Les Mikesell lesmikesell@gmail.com escribio (15.8.2008 20:01)
I would have just used fdisk instead of partd. If you are adding this to a raid, you don't need a filesystem, just a partition of the right size. The contents are going to be wiped by the raid sync anyway.
Thanks for comment. Fdisk was recommended me by another experienced user too, so there is probably a good reason. Though I don't know, what's wrong with using parted.
BTW, this problem partition was not the raid1 partition, but a copy of the boot partition on the startup disk. In case the boot disk ever fails, I hope I can make the 2nd disk bootable by just installing grub.
- Jussi
-- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * SMS +358 40 771 2098 jussi.hirvi@greenspot.fi * http://www.greenspot.fi
Jussi Hirvi wrote:
Les Mikesell lesmikesell@gmail.com escribio (15.8.2008 20:01)
I would have just used fdisk instead of partd. If you are adding this to a raid, you don't need a filesystem, just a partition of the right size. The contents are going to be wiped by the raid sync anyway.
Thanks for comment. Fdisk was recommended me by another experienced user too, so there is probably a good reason. Though I don't know, what's wrong with using parted.
BTW, this problem partition was not the raid1 partition, but a copy of the boot partition on the startup disk. In case the boot disk ever fails, I hope I can make the 2nd disk bootable by just installing grub.
- Jussi
I had this same boot problem you had and i found the following script made by Alex Tkachenko (Thanks Alex!):
====================== CUT HERE ==================================== #!/bin/sh # # Update MBR on both mirror drives # (grub/swraid has problems updating the slave, # as of RHEL3) # Should be run after grub rpm updates as well # # By Alex Tkachenko <alex at ingrian.com>
ADMINDIR=/root/admin
if [ ! -d $ADMINDIR ] then echo $ADMINDIR does not exists. echo Creating $ADMINDIR for storing boot sector backups... mkdir -p $ADMINDIR else echo $ADMINDIR exists. fi
BOOT_ARRAY=`df /boot | awk '/dev/{print $1}'`
# Select only active disks (skip spares) DISKS=`mdadm --query --detail /dev/md0 | awk '/active sync/{print $7}'| sed ' s@/dev/@@g s/,/ /g s/[0-9]//g '`
for d in $DISKS do
cat <<EOF | /sbin/grub --batch --no-floppy device (hd0) /dev/$d root (hd0,0) setup (hd0) quit EOF
# Save updated mbr dd if=/dev/$d of=$ADMINDIR/mbr.$d count=1 done ====================== CUT HERE ====================================
Guy Boisvert, ing. IngTegration inc.
Jussi Hirvi wrote:
I would have just used fdisk instead of partd. If you are adding this to a raid, you don't need a filesystem, just a partition of the right size. The contents are going to be wiped by the raid sync anyway.
Thanks for comment. Fdisk was recommended me by another experienced user too, so there is probably a good reason. Though I don't know, what's wrong with using parted.
BTW, this problem partition was not the raid1 partition, but a copy of the boot partition on the startup disk. In case the boot disk ever fails, I hope I can make the 2nd disk bootable by just installing grub.
I usually create the boot and swap partitions as RAID1 also. Swap so running processes won't crash if 1 disk fails and boot so the copy stays up to date as kernel updates are installed. But if you start with a copy of your working /boot you should be able to fix it up with a rescue-mode boot from the install CD when you need it.
Les Mikesell lesmikesell@gmail.com escribio (16.8.2008 18:45)
I usually create the boot and swap partitions as RAID1 also. Swap so running processes won't crash if 1 disk fails and boot so the copy stays up to date as kernel updates are installed. But if you start with a copy of your working /boot you should be able to fix it up with a rescue-mode boot from the install CD when you need it.
Thanks, that sounds like a good idea. Though I think I have the boot part covered - I have a cron job updating the boot partition on the mirror disk every night.
- Jussi