[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: why kernel don't read partition table?



>   i was looking for mac-fdisk for printing my partition map, so i did:
>
> # mac-fdisk /dev/hda
> p
> [my partition table]
> warning, there is an error ... bla bla bla... press w(rite) to correct.

The precise error message here would be of importance. Did the partition
table appear to be correct?

There is no such message as the above in mac-fdisk. There is such a
message in the powerpc version of fdisk for DOS partition tables, reading:
"Warning: invalid flag <something> of partition table <something> will be
corrected by w(rite)!".

This version of fdisk isn't for Macs, and should not have shown correct
partition information ... but you said you got the information printed, so
I'll assume this isn't what you used.

> (ok, maybe it knows what it say so...)

With that attitude about fdisk usage ... well, let's just say mac-fdisk
has no way to check the partition table is correct. If it is, no reason
to write a 'corrected' table to disk.

For the future: use mac-fdisk -l to just print partition tables.

> w
> q
>
> after a reboot...
>
> cannot open root device hda4 or unknow-block(3,4)
> kernel panic.

And what precisely was the partition map like? Was it a Mac partition
table at all? What's the 'new' partition layout like? How big is the disk?

> with a live distro i cannot read the lost partitions. i don' know what
> to do. please help me, i cannot lose all my data.

As another poster mentioned: the data isn't lost. It might be a bit tricky
to recover, that's all. Please do not attempt to write to the disk in any
way unless you very well know what you're doing.

Back up the whole disk to a spare disk or a disk image on a larger disk
using dd. Create a copy of the current partition map (dd again) to
something like a USB stick and analyze that - you are welcome to send me a
copy of the map to analyze. The first four megs of the disk should be
enough.

It should be possible to locate Linux filesystem superblocks on the disk
to figure out where the partitions are (you should have a rough idea where
to start looking, though). Once you have determined the start of a
partition, losetup --offset can be used to mount that partition from the
disk image directly. Ask a Linux expert in your area for help if in doubt.

	Michael



Reply to: