Re: Restore partition table

From: Bela Lubkin (belal_at_sco.com)
Date: 08/28/03


Date: Thu, 28 Aug 2003 21:13:29 GMT
To: scomsc@xenitec.ca

Frederico Fonseca wrote:

> On Thu, 28 Aug 2003 09:15:29 +0200, Roberto Zini <r.zini@strhold.it>
> wrote:
>
> >gtori wrote:
> > > On SCO Openserver 5.0.6, whit command badtrk -e .... i have cleaned the
> > > partition table.
> > >
> > >
> > > Thre's a tool for restore a correct table, or a tool for search the
> > > first block by any file system on the hard disk ?
> > >
> > > excuse me for the language.
> > >
> > > thanks
> > > --
> > > Posted via http://dbforums.com
> >
> >I think a better explanation of what happened is in order.
> >
> >This guy got in touch with me this afternoon since he wanted to mount an
> >existing SCO OS5 HD (taken from a previously working box) on a new SCO
> >OS5 box as to copy some data from the old HD to the new one.
> >
> >He previously executed "mkdev hd" on the new server (the one where data
> >had to be copied to) but, while doing so, he managed to corrupt the
> >divvy table on the HD, probably because "mkdev hd" executed "badtrk -e"
> >and allocated a new bad tracks table.
> >
> >Dunno about the answers given to "mkdev hd" prompts so I'm unable to
> >describe what he did in detail.
> >
> >As a result, divvy is now unable to detect the previously installed
> >filesystems (on the old HD) and thus he's unable to mount it and copy
> >the data over the new one.
> >
> >Is there a method to recover the original divvy layout ?
> >
> >Best,
> >Roberto
> Doing the following MAY help if the HD is an IDE. Similar could
> eventually be done for SCSI, but you would need to figure out the
> minor/major values.
>
>
> create a directory "dev" in /tmp
> and execute the following code
> ----------------
>
> i=254
> while true
> do
> mknod dev/$i b 1 $i
> i=`expr $i - 1`
> done
>
>
> for i in `ls dev`
> do
> echo $i>>dtype1
> dtype dev/$i>>dtype1 2>>dtype1 1>>dtype1
> done
>
> ------------
> You will now have a directory with several special devices that can be
> "mounted", and a file "dtype1" with a description of each valid file
> system in each special file from /tmp/dev.
>
> You can mount the valid entries as normal.
> e.g. mount -r /tmp/dev/114 /mnt
>
> and then copy whatever you need.
>
> Note sure if it will work now because of the badtracing bit.

Your `while true' loop won't ever stop. But aside from that, this would
only work if the divvy table wasn't destroyed. The device nodes you're
making refer to every division of every partition on all four possible
units of the "wd" driver. (Actually, 4 "wd" units of the "hd" driver,
in a system that is rooting from an IDE drive.) Each of those divisions
and partitions will only be correct if the division and partition tables
are intact.

>Bela<



Relevant Pages

  • Re: Restore partition table
    ... >> partition table. ... >> Thre's a tool for restore a correct table, or a tool for search the ... divvy is now unable to detect the previously installed ... > filesystems and thus he's unable to mount it and copy ...
    (comp.unix.sco.misc)
  • Re: Problem with random disks mount sequence
    ... I'll get random mount sequences. ... At the beginning the USB ... nautilus remember that 'storage3' was 1st partition, ... SCSI drives are listed by order of discovery. ...
    (Fedora)
  • 2.6.32-rc6 - 2.6.32-rc6-git3 misinterpreting fstype on boot
    ... strangeness - misinterpreting the xfs partition as reiserfs. ... proc on /proc type proc ... is a reiserfs partition it needs to mount as "/root"????. ...
    (Linux-Kernel)
  • Re: 2.6.32-rc6 - 2.6.32-rc6-git3 misinterpreting fstype on boot
    ... strangeness - misinterpreting the xfs partition as reiserfs. ... system.board.vendor = 'ASUSTeK Computer INC.' ... is a reiserfs partition it needs to mount as "/root"????. ...
    (Linux-Kernel)
  • Re: Ubuntu second hard drive was Windows partition
    ... Ubuntu second hard drive was Windows partition ... If ntfs-3g does come default in ubuntu, you can probably mount the ... on these lists for a couple of years now and should know what to say and ...
    (Ubuntu)