Loop
September 17th, 2003, 22:17
heyas,

Got a prob with one drive that won't mount. It was working fine before I rebuilt the system (which was 4.8-STABLE), but now I get:

[code:1:bd8f36444b]loop@erwin ~ % sudo mount /dev/da1a /home/public
Password:
mount: /dev/da1a on /usr/home/public: incorrect super block[/code:1:bd8f36444b]

So I tried fsck, with the -n switch so I wouldn't break anything (this drive holds "sensitive data" :wink:

[code:1:bd8f36444b]loop@erwin ~ % sudo fsck -n /dev/da1a
** /dev/da1a (NO WRITE)

CANNOT READ: BLK 16
CONTINUE? yes

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
/dev/da1a: NOT LABELED AS A BSD FILE SYSTEM (unused)[/code:1:bd8f36444b]

OK, try the alternate superblock:

[code:1:bd8f36444b]loop@erwin ~ % sudo fsck -n -b 32 /dev/da1
Alternate super block location: 32
** /dev/da1 (NO WRITE)
BAD SUPER BLOCK: MAGIC NUMBER WRONG[/code:1:bd8f36444b]

So I'm lost ... how can I get the data off this drive?

Kernel_Killer
September 17th, 2003, 22:23
Did you try using the '-p' option with fsck?

soup4you2
September 17th, 2003, 22:41
i would try fsck options first.. and as a LAST RESORT use mount -f
to force a mount

bmw
September 17th, 2003, 22:52
[code:1:b0c9521943]loop@erwin ~ % sudo mount /dev/da1a /home/public
[/code:1:b0c9521943]
Are you sure you have the right slice? Do you want /dev/da1s1a or similar?

frisco
September 17th, 2003, 23:33
What does disklabel on the device show?
What does your /etc/fstab look like?

Is there anything like OpenBSD's scan_ffs(8) for FreeBSD?

In the past, i've run `fsck -n -b` for values from 1 on up looking for superblocks. If it comes to that, you also want a dd copy of the disk, but we're talking worst case scenarios there. Right now it sounds like you need to figure out the correct device and/or figure out the correct disklabel.

Good luck.

Loop
September 18th, 2003, 02:33
[quote:0dedbf8734="Loop"][code:1:0dedbf8734]loop@erwin ~ % sudo mount /dev/da1a /home/public
[/code:1:0dedbf8734]
Are you sure you have the right slice? Do you want /dev/da1s1a or similar?[/quote:0dedbf8734]

Yup, since these disks are on an Alpha (no slices here, just partitions), and mount currently shows:
[code:1:0dedbf8734]loop@erwin /etc/namedb % mount
/dev/da0a on / (ufs, local)
/dev/da0e on /tmp (ufs, local, nodev, noexec, nosuid, soft-updates)
/dev/da0g on /usr (ufs, local, soft-updates)
/dev/da0f on /var (ufs, local, soft-updates)
procfs on /proc (procfs, local)[/code:1:0dedbf8734]

Loop
September 18th, 2003, 02:37
What does disklabel on the device show?

Thanks frisco, this got me the info I needed.

Turns out I was trying to mount the wrong partition :oops:

[code:1:1d979f1b84]
loop@erwin /etc/namedb % sudo disklabel -r /dev/da1
*snip*
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
b: 393216 0 swap # (Cyl. 0 - 24*)
c: 17916240 0 unused 0 0 # (Cyl. 0 - 1115*)
e: 17523024 393216 4.2BSD 2048 16384 89 # (Cyl. 24*- 1115*)
loop@erwin /etc/namedb % sudo mount -r /dev/da1e /home/public
loop@erwin /etc/namedb % mount
/dev/da0a on / (ufs, local)
/dev/da0e on /tmp (ufs, local, nodev, noexec, nosuid, soft-updates)
/dev/da0g on /usr (ufs, local, soft-updates)
/dev/da0f on /var (ufs, local, soft-updates)
procfs on /proc (procfs, local)
/dev/da1e on /usr/home/public (ufs, local, read-only)
[/code:1:1d979f1b84]

cheers!