1830241 Members
6862 Online
109999 Solutions
New Discussion

sfdisk and RedHat 4.0

 
TJ Toedebusch
Occasional Advisor

sfdisk and RedHat 4.0

I have noticed something different on RH 4.0 compared to RH 3.0 and am hoping you all have som e ideas.

We make a back-up bootable copy of our root disk using sfdisk and dd. It works pretty good and allows us to boot to our alternate root disk at will.

In order to get the partition table from root to back-up disk, we use sfdisk -d /dev/cciss/c0d0 | sfdisk /dev/cciss/c0d1 (or /dev/sda, /dev/sdb depending on hardware). This worked great on RH2.1, RH3.0, but fails on RH4.0. Here is the error:

# sfdisk -d /dev/cciss/c0d0 | sfdisk /dev/cciss/c0d1
Checking that no-one is using this disk right now ...
OK

Disk /dev/cciss/c0d1: 17433 cylinders, 255 heads, 32 sectors/track
Old situation:
Units = cylinders of 4177920 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/cciss/c0d1p1 0 - 0 0 0 Empty
/dev/cciss/c0d1p2 0 - 0 0 0 Empty
/dev/cciss/c0d1p3 0 - 0 0 0 Empty
/dev/cciss/c0d1p4 0 - 0 0 0 Empty

sfdisk: unrecognized input: extended partition does not start at a cylinder boundary.


I check all our 4.0 servers and they all do this.

Any ideas? I have tried -f, -L to no avail.

Thanks in advance.
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: sfdisk and RedHat 4.0

Shalom

Please try sfdisk -l

or fdisk -l

The two drives are identical? That makes life a lot easier.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
TJ Toedebusch
Occasional Advisor

Re: sfdisk and RedHat 4.0

The disks appear to be the same sizes, but the error message:
"Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Warning: The partition table looks like it was made
for C/H/S=*/255/63 (instead of 17433/255/32).
For this listing I'll assume that geometry."

is that's throwing me and not allowing me to run sfdisk -d /dev/cciss/c0d0 | sfdisk /dev/cciss/c0d1.

Here is the fdisk/sfdisk output:
Disk /dev/cciss/c0d0: 72.8 GB, 72833679360 bytes
255 heads, 63 sectors/track, 8854 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 653 5245191 83 Linux
/dev/cciss/c0d0p2 654 1306 5245222+ 83 Linux
/dev/cciss/c0d0p3 1307 1828 4192965 82 Linux swap
/dev/cciss/c0d0p4 1829 8854 56436345 5 Extended
/dev/cciss/c0d0p5 1829 3133 10482381 83 Linux
/dev/cciss/c0d0p6 3134 4438 10482381 83 Linux
/dev/cciss/c0d0p7 4439 5743 10482381 83 Linux
/dev/cciss/c0d0p8 5744 6396 5245191 83 Linux
/dev/cciss/c0d0p9 6397 8017 13020651 83 Linux
/dev/cciss/c0d0p10 8018 8854 6723171 83 Linux

##########################################################################################

Disk /dev/cciss/c0d1: 72.8 GB, 72833679360 bytes
255 heads, 32 sectors/track, 17433 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

Device Boot Start End Blocks Id System

##########################################################################################

Disk /dev/cciss/c0d0: 17433 cylinders, 255 heads, 32 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Warning: The partition table looks like it was made
for C/H/S=*/255/63 (instead of 17433/255/32).
For this listing I'll assume that geometry.
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/cciss/c0d0p1 * 0+ 652 653- 5245191 83 Linux
/dev/cciss/c0d0p2 653 1305 653 5245222+ 83 Linux
/dev/cciss/c0d0p3 1306 1827 522 4192965 82 Linux swap
/dev/cciss/c0d0p4 1828 8853 7026 56436345 5 Extended
/dev/cciss/c0d0p5 1828+ 3132 1305- 10482381 83 Linux
/dev/cciss/c0d0p6 3133+ 4437 1305- 10482381 83 Linux
/dev/cciss/c0d0p7 4438+ 5742 1305- 10482381 83 Linux
/dev/cciss/c0d0p8 5743+ 6395 653- 5245191 83 Linux
/dev/cciss/c0d0p9 6396+ 8016 1621- 13020651 83 Linux
/dev/cciss/c0d0p10 8017+ 8853 837- 6723171 83 Linux

##########################################################################################

Disk /dev/cciss/c0d1: 17433 cylinders, 255 heads, 32 sectors/track
Units = cylinders of 4177920 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/cciss/c0d1p1 0 - 0 0 0 Empty
/dev/cciss/c0d1p2 0 - 0 0 0 Empty
/dev/cciss/c0d1p3 0 - 0 0 0 Empty
/dev/cciss/c0d1p4 0 - 0 0 0 Empty
Ivan Ferreira
Honored Contributor

Re: sfdisk and RedHat 4.0

Try this:

Zero your current mbr:

dd if=/dev/zero of=/dev/cciss/c0d1 bs=512 count=1

Then run fdisk to the /dev/cciss/c0d1 disk. Then just enter "w", this will correct any problems in the partition table.

Now run sfdisk.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?