UFS Mounting UFS drive

Situation: Server stops booting (I think running FreeBSD 9.1).
Put in backup drive. Machine now boots up fine.
Try to mount the original drive and can't. Not sure if it is the drive or my lack of experience.

camcontrol devlist
Code:
<Maxtor 7Y250P0 YAR41BW0>          at scbus1 target 0 lun 0 (pass0,ada0)
<Maxtor 7Y250P0 YAR41BW0>          at scbus1 target 1 lun 0 (pass1,ada1)
ls -la /dev/ada1*
Code:
crw-r-----  1 root  operator  0x61 Feb 18 09:05 /dev/ada1
crw-r-----  1 root  operator  0x6a Feb 18 09:05 /dev/ada1p1
crw-r-----  1 root  operator  0x6c Feb 18 09:05 /dev/ada1p2
crw-r-----  1 root  operator  0x6e Feb 18 09:05 /dev/ada1p3
gpart show ada1
Code:
=>       34  490234685  ada1  GPT  (234G)
         34        128     1  freebsd-boot  (64K)
        162  482344832     2  freebsd-ufs  (230G)
  482344994    7889724     3  freebsd-swap  (3.8G)
  490234718          1        - free -  (512B)
mount /dev/ada1p1 /billtemp
Code:
mount: /dev/ada1p1: Input/output error
I guess I am trying to figure out if the drive is bad or just corrupted (and maybe learn something is the process).

I know I could reformat and such but there is some data that would be convenient (but not critical) to have.

Any suggestions greatly appreciated.

Thanks,
Bill
 
You can use sysutils/smartmontools to get some health report of the disk. To check the file system fsck /dev/ada1p1 should be appropriate if I remember correctly. To access the files you like to copy please try to mount read-only by mount -ro /dev/ada1p1 /billtemp.
 
p1 is the boot partition. There is no filesystem on it. See the output of gpart, which shows that the freebsd-ufs partition number is 2. So the mount command is mount /dev/ada1p2 /billtemp.

It might refuse to mount because the filesystem is dirty, and fsck(8) must be run on it first. I would make a backup first, with dd(1) if dump(8) refuses to run on that filesystem.
 
Thanks for the replies.

I did try mounting p2 before (I never noticed the partition column before though), here is the output:
mount -t ufs /dev/ada1p2 /billtemp
Code:
mount: /dev/ada1p2: Invalid argument
# fsck /dev/ada1p1
Code:
fsck: Could not determine filesystem type
fsck -t ufs /dev/ada1p1
Code:
** /dev/ada1p1

CANNOT READ BLK: 128
CONTINUE? [yn] n
fsck -t ufs /dev/ada1p2
Code:
** /dev/ada1p2
Cannot find file system superblock
ioctl (GCINFO): Inappropriate ioctl for device
fsck_ufs: /dev/ada1p2: can't read disk label
Hmmm, I could trying forcing the fsck on ada1p1 or study up on superblock stuff.
Again, not too worried about losing data on drive at this point.

Ideas?

Bill
 
p1 is the boot partition. There is no filesystem on it. See the output of gpart, which shows that the freebsd-ufs partition number is 2. So the mount command is mount /dev/ada1p2 /billtemp.
Thank you for correcting me, I have just copied the original line without re-thinking. But as often something bad can be at least useful as an example. Using labels this mistake should not have occured. It is an opportunity to thank you for http://www.wonkity.com/~wblock/docs/html/labels.html!
 
Back
Top