# Lost Superblocks for /tmp and /var



## DrJ (Jul 22, 2009)

The title says it all.  

I moved a JBOD SCSI disk set from one computer to another; /dev/da0 has the OS, /dev/da1 has /home, and /dev/da2 has data.  When I booted on the "new" computer, fsck was unable to find the superblock on da0s1d and da0s1e, which are /tmp and /var respectively.  

Both old and new computers use LSI SCSI controllers, and I have shuffled FreeBSD disks around for years without any issue.

There is also XP on a fourth disk, and it uses GAG to select the proper OS.  No, XP will not work on the new box.

What can I do to restore the disk (da0) to a functioning state?  I'd like to keep the information in /var at least; that in /tmp is less important.


----------



## fronclynne (Jul 23, 2009)

http://lists.freebsd.org/pipermail/freebsd-questions/2003-December/027972.html
suggests dd(1) of the backup superblock into the original.

I would suggest `# dd if=/dev/da0s1d of=back_up.file` so you can preserve the actual data in case the superblock restoration fails horribly.

If you've used any funny -b -f or -i for newfs, `# newfs -N -b 2048` etc etc will give you a good idea of where the backups may be.


----------



## mdhughes (Jul 28, 2009)

I would run fsck_ufs/fsck_ffs and try using an alternate superblock to see if that will fix the problem.  If you don't know the block number of an alternate superblock, you can run  newfs -N <dev> and it will list the alternates.


----------

