Fix partition 26 from its saved partition table?

Fix partition 26 from its saved partition table?

Post by n.. » Mon, 07 Nov 2005 15:04:01




> > is it possible to fix partition 26 from its saved partition table,
> > in principle?
> > For certain reasons I need to have many partitions eg. on a
> > 80 GB IDE.
> > ...
> > Would this work:
> > * since I have a record of the sizes of partitions 24, 25, 26, 27..,
> > if I recreate partition 26 at the same size as previously, without
> > reformatting, the contents may be saved ?

> > * but then apparently the 'tail' of partition 26 [probably via
> > its table, will (wrongly be marked as the END partition) ] ?

> > Creating partitons by linux's fdisk or cfdisk obviously rounds-off
> > the sector counts for the given MB size.  I guess I used the
> > same utility to create the consecutive partitions, so if
> > partn 24, 25 are say 16 MB, then I can check exactly how many
> > sectors they have, and assume that damaged partn 26 has the
> > same number of sectors ?

> > This is what the IDE looks like now:-
> > IDE0#00  76319MB --- (Whole disk)
> > IDE0#01   1004MB  11 * Win 95/98, FAT32
> > ...
> > IDE0#23    125MB 131 |Linux fs
> > IDE0#24     62MB  76 |Native Oberon, Aos
> > IDE0#25     62MB  76 |Native Oberon, Aos
> > IDE0#26  29455MB --- (Free)
> > IDE0#27   1270MB --- |(Free)

> >  and I can find the listing of the sizes up to the previous tail of
> > partition-chain, before the problem occured.

> > I'm guessing that if I can just replace the last 'link' [now a tail-link]
> > with a link to the next partition. it would be OK ?

> I would recommend that before you do any mucking around, you first copy
> the contents of the missing partition to a file. You should be able to do
> it easily using something like

> dd if=/dev/hda of=backupfile skip=nnnn count=nnnn

OK, but you'd have to know where the partition[s] start and end.
That's what it's all about ? The rest is easy ?
I'm guessing that if I keep a safety copy of the start-sector-number of
all my logical-partitions, then I can always restore if the 'chain breaks' ?

Quote:> then if something goes awry you can always recreate the partition in any
> old manner and copy the data back. You may want to copy all the partitions
> out this way, perhaps to an external USB drive, then recreate the whole
> mess. I'd also check for bad blocks on the device - things don't disappear
> for no reason.
> You can also use sfdisk to scan the disk for partitions.

Well no, it doesn't 'scan' as per searching each block and making
heuristic guesses [like some utilities try]; it just 'links through' like
fdisk & cfdisk does ?

Quote:> If I were doing this, I would do the following:
> 1) sfdisk to scan for partitions
> 2) dd to copy partitions to files - at least for missing partitions

OK once the partition boundry's are determined ?

Quote:> 3) badblocks to check the drive

My 'man badblocks' want to refer to partitions.
I need to refer to a range of blocks.
It seems that only dd can do this ?

Quote:> 4) attempt to recreate missing partitions - if the process doesn't work
> quite right, then simply repartition to approximate values and one
> partition at a time, mount via loop the backup file and copy the data back.

I've never understood "loop", I'll have to seek some docu. explanation.

Thanks,

== Chris Glur.

 
 
 

Fix partition 26 from its saved partition table?

Post by Tauno Voipi » Mon, 07 Nov 2005 17:42:05



> OK, but you'd have to know where the partition[s] start and end.
> That's what it's all about ? The rest is easy ?
> I'm guessing that if I keep a safety copy of the start-sector-number of
> all my logical-partitions, then I can always restore if the 'chain breaks' ?

Get the 'gpart' utility and do not allow it to
repair the table before taking a back-up.

--

Tauno Voipio
tauno voipio (at) iki fi

 
 
 

Fix partition 26 from its saved partition table?

Post by n.. » Sat, 12 Nov 2005 13:12:18




> > OK, but you'd have to know where the partition[s] start and end.
> > That's what it's all about ? The rest is easy ?
> > I'm guessing that if I keep a safety copy of the start-sector-number of
> > all my logical-partitions, then I can always restore if the 'chain breaks' ?


> Get the 'gpart' utility and do not allow it to
> repair the table before taking a back-up.

This is what Oberon-Sys3 can do [from a 4 MB software installation]:-
Quote:><><><><><><><><><><><><><><><><><><

Disk: IDE0, 74GB = 156301488 * 512, CHS: 155061*16*63, ST380011A, mntcnt=1
IDE0#00          0 156301488 76319MB --- (Whole disk)
IDE0#01         63   2056257  1004MB  11 * Win 95/98, FAT32
IDE0#02    2056320   2056320  1004MB  11 Win 95/98, FAT32
IDE0#03    4112640   2056320  1004MB 131 Linux fs
IDE0#04    6168960  89787285 43841MB   5 Extended
IDE0#05    6169023   2104452  1027MB 131 |Linux fs
IDE0#06    8273538   4208967  2055MB 131 |Linux fs
..........
IDE0#19   91329588    256977   125MB 131 |Linux fs
IDE0#20   91586628    497952   243MB  76 |Native Oberon, Aos
IDE0#21   92084643    497952   243MB 131 |Linux fs
IDE0#22   92582658    256977   125MB 131 |Linux fs
IDE0#23   92839698    256977   125MB 131 |Linux fs
IDE0#24   93096738    128457    62MB  76 |Native Oberon, Aos
IDE0#25   93225258    128457    62MB  76 |Native Oberon, Aos
IDE0#26   95956245  60324075 29455MB --- (Free)
IDE0#27   93353778   2602467  1270MB --- |(Free)
Quote:><><><><><><

And this is what Mandrake9's gpart does:

 Try:  gpart -k 93096700 /dev/hdb  ==
 ** Error: invalid extended ptbl found at sector(12482505).

 *** Fatal error: dev(/dev/hdb): seek failure.
fdisk sees only the first 16 partitions and cfdisk can't even start !
Although I must admit that gpart [I think it was anewer version]
once fixed an IDE for me.
 ===
 OK a later [2004 version of ] gpart does better.
 In fact it previously fixed another IDE, but I can't get it to fix hdb26.

 Thanks,

 == Chris Glur

 
 
 

1. Fix partition 26 from its saved partition table?

Hi,

is it possible to fix partition 26 from its saved partition table,
in principle?
For certain reasons I need to have many partitions eg. on a
80 GB IDE.

Is it true that the logical partitions are all chained together,
so that if one link of the chain is lost, the later partitions won't be
accessible ?

Would this work:
* since I have a record of the sizes of partitions 24, 25, 26, 27..,
if I recreate partition 26 at the same size as previously, without
reformatting, the contents may be saved ?

* but then apparently the 'tail' of partition 26 [probably via
its table, will (wrongly be marked as the END partition) ] ?

Creating partitons by linux's fdisk or cfdisk obviously rounds-off
the sector counts for the given MB size.  I guess I used the
same utility to create the consecutive partitions, so if
partn 24, 25 are say 16 MB, then I can check exactly how many
sectors they have, and assume that damaged partn 26 has the
same number of sectors ?

This is what the IDE looks like now:-
IDE0#00  76319MB --- (Whole disk)
IDE0#01   1004MB  11 * Win 95/98, FAT32
...
IDE0#23    125MB 131 |Linux fs
IDE0#24     62MB  76 |Native Oberon, Aos
IDE0#25     62MB  76 |Native Oberon, Aos
IDE0#26  29455MB --- (Free)
IDE0#27   1270MB --- |(Free)

 and I can find the listing of the sizes up to the previous tail of
partition-chain, before the problem occured.

I'm guessing that if I can just replace the last 'link' [now a tail-link]
with a link to the next partition. it would be OK ?

Can one in principle read and write to absolute C,H,S addresses ?
 I guess I may have to do some manual LBA calculations ?

Any advice would be much appreciated.

== Chris Glur.

2. Adaptec AVA-2825

3. Saving Partition tables and boot records

4. Polling files question

5. fdisk not saving partition table. Pls help.

6. Driver information for Solaris X.86

7. saving partition table

8. CDROM mounting

9. Saving partition table.

10. DOS FDISK trashed my partition table, can I save my Linux on /dev/hda3

11. saving partition table