[CentOS] Hard disk, format, filesystem SOLVED

Fri Aug 15 16:07:48 UTC 2008
Jussi Hirvi <greenspot at 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 at mail dev]# mkfs ext3 sdb1
>> mke2fs 1.39 (29-May-2006)
>> mkfs.ext2: invalid blocks count - sdb1

- Jussi

Jussi Hirvi (greenspot at 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 at 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 at mail dev]# mkfs ext3 sdb1
> mke2fs 1.39 (29-May-2006)
> mkfs.ext2: invalid blocks count - sdb1
> 
> // I cannot create a volume label:
> [root at mail dev]# e2label sdb1 /mnt/mirror
> [root at mail dev]# e2label sdb1
> 
> [root at mail dev]#
> 
> 
> //fsck informs me like this:
> 
> [root at 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 at greenspot.fi * http://www.greenspot.fi
> 
> _______________________________________________
> CentOS mailing list
> CentOS at 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 at greenspot.fi * http://www.greenspot.fi