Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jan 2011 00:01:14 +0100
From:      Andrea Venturoli <ml@netfence.it>
To:        freebsd-questions@freebsd.org
Subject:   Mounting a recovered disk
Message-ID:  <4D361BBA.808@netfence.it>

next in thread | raw e-mail | index | archive | help
Hello.

I'm trying a rescue on a failing drive.

I used ddrescue to get an image (which showed a single unreadable sector).

> # file myimage
> myimage: x86 boot sector, LInux i386 boot LOader; GRand Unified Bootloader, stage1 version 0x3, stage2 address 0x2000, stage2 segment 0x200; partition 1: ID=0x7, active, starthead 1, startsector 63, 40965687 sectors; partition 2: ID=0x82, starthead 254, startsector 40965750, 2104515 sectors; partition 3: ID=0x83, starthead 254, startsector 43070265, 36965565 sectors, code offset 0x48

Then i used "mdconfig -f myimage" and now I have
> # ls -l /dev/|grep md0
> crw-r-----  1 root  operator    0, 111 Jan 18 23:42 md0
> crw-r-----  1 root  operator    0, 112 Jan 18 23:42 md0s1
> crw-r-----  1 root  operator    0, 113 Jan 18 23:42 md0s2
> crw-r-----  1 root  operator    0, 114 Jan 18 23:42 md0s3

Fdisk gives:

> # fdisk /dev/md0
> ******* Working on device /dev/md0 *******
> parameters extracted from in-core disklabel are:
> cylinders=4982 heads=255 sectors/track=63 (16065 blks/cyl)
>
> Figures below won't work with BIOS for partitions not in cyl 1
> parameters to be used for BIOS calculations are:
> cylinders=4982 heads=255 sectors/track=63 (16065 blks/cyl)
>
> Media sector size is 512
> Warning: BIOS sector numbering starts with sector 1
> Information from DOS bootblock is:
> The data for partition 1 is:
> sysid 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX)
>     start 63, size 40965687 (20002 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 1023/ head 254/ sector 63
> The data for partition 2 is:
> sysid 130 (0x82),(Linux swap or Solaris x86)
>     start 40965750, size 2104515 (1027 Meg), flag 0
>         beg: cyl 1023/ head 254/ sector 63;
>         end: cyl 1023/ head 254/ sector 63
> The data for partition 3 is:
> sysid 131 (0x83),(Linux native)
>     start 43070265, size 36965565 (18049 Meg), flag 0
>         beg: cyl 1023/ head 254/ sector 63;
>         end: cyl 1023/ head 254/ sector 63
> The data for partition 4 is:
> <UNUSED>

Now I'd expect to mount as follows, but I get errors:

> # mount -r -t ntfs /dev/md0s1 /mnt/
> mount_ntfs: /dev/md0s1: Invalid argument
> # mount -r -t ext2fs /dev/md0s3 /mnt/
> mount: /dev/md0s3 : Invalid argument

Instead the following works, which surprises me (and is useless, anyway):

> # mount -t ext2fs /dev/md0s1 /mnt/
> # find /mnt/
> /mnt/
> /mnt/lost+found

Just in case:

> # kldstat
> Id Refs Address    Size     Name
>  1   20 0xc0400000 5cc790   kernel
>  2    1 0xc09cd000 353c     splash_bmp.ko
>  3    1 0xc46c3000 10000    geom_eli.ko
>  4    1 0xc46d3000 23000    crypto.ko
>  5    1 0xc46f7000 a000     zlib.ko
>  6    2 0xc4fc3000 b000     ntfs.ko
>  7    1 0xc501c000 10000    ext2fs.ko
>  8    1 0xc5041000 2000     ntfs_iconv.ko
>  9    1 0xc5043000 4000     libiconv.ko


Am I doing something wrong?



  bye & Thanks
	av.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D361BBA.808>