gpart recovery FreeBSD 7.4

Jean M. Vandette jmvandette at
Tue Apr 3 04:14:12 UTC 2018


Found an old post on partition repair

Got the scan_ffs an here are the results:

root at central:~ # scan_ffs -l /dev/mfid0
X: 2097152 9786530 4.2BSD 2048 16384 0 # /
X: 2097152 9787042 4.2BSD 2048 16384 0 # /
X: 4194304 12232866 4.2BSD 2048 16384 0 # /tmp
X: 41943040 17126306 4.2BSD 2048 16384 0 # /usr
X: 42068388 17126818 4.2BSD 2048 13350 0 # /usr
X: 62914560 66061474 4.2BSD 2048 16384 0 # /usr/local
X: 83886080 139462050 4.2BSD 2048 16384 0 # /var
X: 1258291200 237328290 4.2BSD 2048 16384 0 # /usr/local/system
X: 21973958460 1705333922 4.2BSD 2048 16384 0 # /usr/local/storage
X: 21973958460 1705334434 4.2BSD 2048 16384 0 # /usr/local/storage

The gpart show is

=>         40  27341619120  mfid0  GPT  (13T)
           40          128      1  freebsd-boot  (64K)
          168      8388602      2  freebsd-swap  (4.0G)
      8388770      2097152      3  freebsd-ufs  (1.0G)
     10485922      4194304      4  freebsd-ufs  (2.0G)
     14680226     41943040      5  freebsd-ufs  (20G)
     56623266     62914560      6  freebsd-ufs  (30G)
    119537826     83886080      7  freebsd-ufs  (40G)
    203423906   1258291200      8  freebsd-ufs  (600G)
   1461715106  25879904054      9  freebsd-ufs  (12T)

It seems to differ from the scan of the file system

Your thoughts?


Jean M. Vandette

SecureNet Information Services
Net-Vu Television Distribution
Divisions 159272 Canada Inc.
283-100 Alexis Nihon Blvd
St Laurent, Quebec H4M 2N7
514-744-1552 Fax

Les informations contenues au présent courriel ainsi que dans tout document annexé sont de nature privilégiée et confidentielle et ne peuvent être utilisées que par la ou les personnes ou entités dont le nom paraît ci-dessus. Si le lecteur du présent message n'est pas le destinataire prévu ou n'a pas été mis en copie, il est par les présentes prié de noter qu'il est strictement interdit de divulguer, de distribuer de copier ou d'utiliser de quelconque façon ce message ou ses annexes. Si ceux-ci vous ont été transmis par mégarde, veuillez les effacer et nous en aviser immédiatement.

This E-mail along with its attachments, if any, contain privileged and confidential information intended only for the use of the individuals or entities named above. Any dissemination, distribution, copying or use of the same by anyone other than the intended recipients is strictly prohibited. If you have received this communication in error, please delete both E-mail and attachments and notify us immediately.

-----Original Message-----
From: Erich Dollansky [mailto:freebsd.ed.lists at]
Sent: Sunday, April 01, 2018 11:51 PM
To: Jean M. Vandette <jmvandette at>
Cc: freebsd-questions at
Subject: Re: gpart recovery FreeBSD 7.4


On Sat, 31 Mar 2018 18:43:06 +0000
"Jean M. Vandette" <jmvandette at> wrote:

> I used the recoverdisk
> root at central:/ # recoverdisk /dev/gpt/root /mnt2/root.img

I never used this program.

> I did newfs on the boot then it mounted seems it does not recognize

That was dangerous. When I have had the problem I really went down to read the partition information from the disk into a file and tried to understand it.

This method helped recently when a disk has had developed so many bad sectors that it shrank its size during a boot. So, I did the same with its GPT information, mounted it, made a backup of the last hours of work and returned it to the manufacturer.

> I don't have other mount points ie disks to make copy.

This is a real problem at this stage.

> the recoverydisk with state 0 says it encountered no errors so it is
> seeing the data (I presume) just it is a binary file it seems.  Now is
> the data usable is another question.  Using more or less I see a lot
> of binary gibberish so far.

Yes, the data is all binary. The key to any disk is its first sector.
> I don't know if there is a way to write the superblock information
> without losing all the data if you or anyone knows I would appreciate
> the procedure. Did it once before or should say my mentor did it back
> on 3.1 and then was able to fsck and mount the data.

This is all not a problem but it come much, much later. There is something wrong with your partitioning tables. I would try to find this out.

Get a hex editor of your choice. dd the first sector of the disk, open it in the editor. I used Wikipedia to provide me with the structure information of the disk. This all depends how it was partitioned and later formatted. MBR, GPT ...

I know that this is hard work and will take time.


Checked by AVG. Version: 16.0.8039 / Virus Database: 4793/15535 - Release Date: Mon Apr 02 09:04:00 2018.
The message does not contain any threats.

More information about the freebsd-questions mailing list