# ffs2recov option to get alternate superblocks



## kavitakr (Jan 12, 2022)

BROKEN_FreeBSD_13=    Changes made to the ffs2 filesystem in FreeBSD 13 are no longer compatible with ffs2recov








						ports
					

FreeBSD ports tree




					gitea.ttmath.org
				




After we migrated to FreeBSD 13 this tool is broken.

In our legacy code we used to use `ffs2recov -s $dev` to get the alternate superblock for filesystem recovery.

ffsrecov(1):

```
-s Find possible superblocks in the filesystem. If there is a valid cylinder group following it, it will print out where the beginning of the file system is. This may not be correct if there are stray superblock/cylinder group pairs on the disk, such as in swap
```
Any alternative tool to do the same, to get the alternate superblocks when the filesystem goes bad?


----------



## VladiBG (Jan 12, 2022)

`newfs -N $dev`

fsck_ffs(8) see -b flag


----------



## kavitakr (Jan 13, 2022)

Thanks newfs -N $dev gives superblocks but I think if we created the filesystem with different options so the blocks shown are different from the one from fss2recov.


I did find one more tool find-sb and it lists all the superblocks properly . But incase of ffs2recov 

superblock: 15032713216(byte), 29360768(block), cg: 15032778752(byte), 29360896(block), 1(nth), fs begin: 27263232(block), primary sb at: 27263360(block)

cylinder group also used to get listed which was useful . Is there any other tool to list full details like ffs2recov


----------

