# Lost /var Cannot find file system superblock



## Understudy (Aug 7, 2012)

So my laptop running FreeBSD 8.3 froze yesterday.

I had to hold the power button and force a reboot. 

I go into single user mode 
`# fsck -y`

I received this:

```
** /dev/ad4s1d
Cannot find file system superblock
ioctl (GCINFO): Inappropriate ioctl for device
fsck_ufs: /dev/ad4s1d: can't read disk label
```

So it appears my /var directory became corrupt. What is the best way for me to handle this relabel the slice or something else?


----------



## jb_fvwm2 (Aug 7, 2012)

Not enough ideas here, but in the exact same situation (maybe) I mtree'd a new var

```
/etc/mtree/BSD.var.dist
```
... the command was not at this machine, so I don't remember it exactly. (and maybe copied files to it from another v9 or backup)
and mounted it under / (root). But maybe your var error is
from a missing bsdlabel, or similar, and not an actual hardware fault.


----------



## jb_fvwm2 (Aug 7, 2012)

Just remembered that I reinstalled /var/db/pkg by importing a local.sqlite from a similar setup (/ports-mgmt/pkg/)and 
	
	



```
pkg which /usr/local/bin...
pkg which /usr/local/sbin...
```
installed ports which were already in /usr and only "somewhat" fully installed.


----------



## monkeyboy (Aug 8, 2012)

what happens if you tell fsck to use an alternate superblock?
e.g. fsck -b 32 ...

Of course if the disk label is really clobbered... well try to relabel the disk. You *do* have a backup listing or knowledge of the original slicing, yes?


----------



## Understudy (Aug 8, 2012)

I will try the alternate superblock. I do have a backup but I was hoping to see if there were alternatives. I will give that a try. Thank you.


----------



## Understudy (Aug 12, 2012)

Well it looks like things did not go well. I did an alternate superblock but it basically failed again. So I am going to replace the drive. I am glad I had backups. However I was bummed because I wanted to see if this could be fixed without replacing the drive. No such luck.


----------



## monkeyboy (Aug 13, 2012)

did you try just re-labeling the drive (without newfs)?
perhaps the partition table just got clobbered...


----------

