# Can I fix or recover a UFS partition?



## fredBSD (Apr 14, 2009)

I've been using an old HDD mounted in a USB caddy for users home folders, svn repositories and the ports framework. All was fine (on FreeBSD-6.3) until I tried to use it with a FreeBSD-7.1 main HDD (CF card). I could initially mount the UFS partition manually with:

# mount /dev/da0s1f /usb

I could then view the various partitions. After trying to mount it automatically with an entry in /etc/fstab (which always worked OK on 6.3) no complaints were seen, but instead of the partition, there was just a single old file listed by ls:

svn# ll /usb
-rw-r--r--  1 root  wheel  598 Nov 24  2004 /usb

Unmounting it and remounting manually initially worked, but now, whatever I do, I just see the same old file. The HDD is now out of its caddy and connected to a different 7.1 installation and the problem remains. I can mount the other two partitions (s1d and s1e) OK. bsdlabel shows everything looking good:

```
svn# bsdlabel /dev/ad1s1
# /dev/ad1s1:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  c: 16841601        0    unused        0     0         # "raw" part, don't edit
  d:  1024000        0    4.2BSD     2048 16384 64008
  e:  2097152  1024000    4.2BSD     2048 16384 28552
  f: 13720449  3121152    4.2BSD     2048 16384 28552
```
And df seems to show the right sort of usage:

```
svn# mount -v /dev/ad1s1f /usb
/dev/ad1s1f on /usb (ufs, local, soft-updates, fsid 678715455e953592)
svn# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad0s1a    259M    138M    100M    58%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ad0s1e    142M     12K    131M     0%    /tmp
/dev/ad0s1f    1.9G    424M    1.4G    23%    /usr
/dev/ad0s1d    166M    270K    153M     0%    /var
/dev/ad1s1f    6.3G    961M    4.9G    16%    /usb
```
Is there some way to retrieve the files? Any idea what could have happened?

Thanks.


----------

