* Correct partition table geometry?(Story included)
@ 2008-05-31 2:38 Tuc at T-B-O-H.NET
2008-05-31 12:39 ` Mark Lord
0 siblings, 1 reply; 3+ messages in thread
From: Tuc at T-B-O-H.NET @ 2008-05-31 2:38 UTC (permalink / raw)
To: linux-ide
Hi,
An "acquaintance" runs a Wireless ISP with 2 Centos
servers. One of the servers disks (80G) is about to die, so he used
his limited Unix knowledge and :
* Went out
* Bought 500G drive
* Installed it
* Did dd if=/dev/hda of=/dev/hdb while the system was running
* Rebooted
* Had all SORTS of issues
Once he took the drive out, and rebooted, everything was fine.
I found it was grub and /etc/fstab referencing LABEL= instead of
/dev/hda*. Ok, that fixed, he puts it back into the box, reboots,
everything is fine.
I know that if he tries to run off the 500, he'll only
get 80 out of it since he's wrecked the partition table of the
500G with the info of it being an 80G.
I pull up fdisk on the 500G and get :
Disk /dev/hdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 127 1020096 83 Linux
/dev/hda2 128 185 465885 82 Linux swap
/dev/hda3 186 312 1020127+ 83 Linux
/dev/hda4 313 9729 75642052+ 5 Extended
/dev/hda5 313 439 1020096 83 Linux
/dev/hda6 440 1714 10241406 83 Linux
I'm not paying much attention, but I see that the extended
ends at 9729, but his last partition ends at 1714. Not even thinking
I figure somehow Linux has realized the extended partition has alot
more room and compensated. Bully for Linux!
So I delete hdb6, create a new one from 440 to 9729.
I "mkfs.ext3 /dev/hdb6", mount it, and start to rsync the
/dev/hda6 content to it. In another window I pull up a "df" and
see :
Filesystem 1K-blocks Used Available Use% Mounted on
(etc)
/dev/hdb6 73449660 200128 69518440 1% /mnt/usr
Somethings not making sense.... So I switch to "df -B G"..
[root@ports /]# df -B G
Filesystem 1G-blocks Used Available Use% Mounted on
/dev/hda1 1G 1G 1G 16% /
none 1G 0G 1G 0% /dev/shm
/dev/hda5 1G 1G 1G 2% /tmp
/dev/hda6 10G 3G 7G 32% /usr
/dev/hda3 1G 1G 1G 33% /var
/dev/hdb6 71G 1G 67G 1% /mnt/usr
So it looks like the guy didn't even configure all of the
80G he had available to him! It looks like he only used 14.5G
(1/2 G for swap)
I'm wondering the best suggestions, hopefully with the
disk still in the case, that I can get the new 500G configured to
use the most amount of space, be bootable, etc. .
I first probably should just delete all the partitions,
they aren't worth anything. My next thing would be to correct
the number of cylinders. I've never had to correct cylinders
before, so not sure where to look or if I just delete all the partitions
will it come back properly? (I'm doubting it). Am I just kidding myself
that I can recover this easily with it still in a live system? I'll
partition and create new partitions (If anyone knows the "default"
mkfs2 line I'd appreciate it). I'll rsync the content. The final part I'm
guessing is to get grub active on it and willing to boot, something
I never did outside the confines of a CD install.
Sorry for the diatribe.... And appreciate any help.
The disk shows up in dmesg as :
ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA, hdb:pio
hdb: ST3500630A, ATA DISK drive
hdb: max request size: 1024KiB
hdb: 976773168 sectors (500107 MB) w/16384KiB Cache, CHS=60801/255/63, UDMA(100)
hdb: cache flushes supported
hdb: hdb1 hdb2 hdb3 hdb4 < hdb5 hdb6 >
Thanks, Tuc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Correct partition table geometry?(Story included)
2008-05-31 2:38 Correct partition table geometry?(Story included) Tuc at T-B-O-H.NET
@ 2008-05-31 12:39 ` Mark Lord
2008-05-31 21:28 ` Tuc at T-B-O-H.NET
0 siblings, 1 reply; 3+ messages in thread
From: Mark Lord @ 2008-05-31 12:39 UTC (permalink / raw)
To: Tuc at T-B-O-H.NET; +Cc: linux-ide
Tuc at T-B-O-H.NET wrote:
>
> Disk /dev/hdb: 500.1 GB, 500107862016 bytes
> 255 heads, 63 sectors/track, 60801 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
> Device Boot Start End Blocks Id System
> /dev/hda1 * 1 127 1020096 83 Linux
> /dev/hda2 128 185 465885 82 Linux swap
> /dev/hda3 186 312 1020127+ 83 Linux
> /dev/hda4 313 9729 75642052+ 5 Extended
> /dev/hda5 313 439 1020096 83 Linux
> /dev/hda6 440 1714 10241406 83 Linux
..
You could fire up fdisk, delete hda6, hda5, hda4,
then recreate hda4 extending over the entire free space,
then recreate hda5, hda6 *exactly* as before (above),
and then hda7 with the remaining free space.
And only *then* commit the changes to disk.
No need to reformat hda5,hda6 this way, their contents will
survive the repartitioning if they are recreated exactly
as before.
Done. Entire disk now accessible.
But personally, I wouldn't do this. I'd just create a new
partition scheme that makes more sense, and then file-copy
everything over from the old 80GB drive to the new scheme,
re-run grub-install on the new drive, and be done with it.
Cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Correct partition table geometry?(Story included)
2008-05-31 12:39 ` Mark Lord
@ 2008-05-31 21:28 ` Tuc at T-B-O-H.NET
0 siblings, 0 replies; 3+ messages in thread
From: Tuc at T-B-O-H.NET @ 2008-05-31 21:28 UTC (permalink / raw)
To: Mark Lord; +Cc: Tuc at T-B-O-H.NET, linux-ide
>
> Tuc at T-B-O-H.NET wrote:
> >
> > Disk /dev/hdb: 500.1 GB, 500107862016 bytes
> > 255 heads, 63 sectors/track, 60801 cylinders
> > Units = cylinders of 16065 * 512 = 8225280 bytes
> >
> > Device Boot Start End Blocks Id System
> > /dev/hda1 * 1 127 1020096 83 Linux
> > /dev/hda2 128 185 465885 82 Linux swap
> > /dev/hda3 186 312 1020127+ 83 Linux
> > /dev/hda4 313 9729 75642052+ 5 Extended
> > /dev/hda5 313 439 1020096 83 Linux
> > /dev/hda6 440 1714 10241406 83 Linux
> ..
>
> You could fire up fdisk, delete hda6, hda5, hda4,
> then recreate hda4 extending over the entire free space,
> then recreate hda5, hda6 *exactly* as before (above),
> and then hda7 with the remaining free space.
> And only *then* commit the changes to disk.
>
> No need to reformat hda5,hda6 this way, their contents will
> survive the repartitioning if they are recreated exactly
> as before.
>
> Done. Entire disk now accessible.
>
> But personally, I wouldn't do this. I'd just create a new
> partition scheme that makes more sense, and then file-copy
> everything over from the old 80GB drive to the new scheme,
> re-run grub-install on the new drive, and be done with it.
>
Hi,
Thanks for the reply. Yea, I thought later I could
look at it just fdisking in memory. Turns out it did open up
once I deleted the extended. I'm a bit leary about placing
the 5+6 back where they were. Since the disk partition table
was DD'd, not fdisk'd, I'd be concerned the boundary would
be the EXACT same place. I actually ended up deleting the
whole table up until hdb1, and recreating swap down. mkswap
and "mk2fs -t ext3" and copied everything over.
In effect I pretty much did that, leaving only the
hdb1 intact (And the partition table). I'm going to run
some more copies and then we'll swap it over to the primary
and go from there.
Thanks!
Tuc
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-31 21:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-31 2:38 Correct partition table geometry?(Story included) Tuc at T-B-O-H.NET
2008-05-31 12:39 ` Mark Lord
2008-05-31 21:28 ` Tuc at T-B-O-H.NET
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.