I have a usb stick, which contains the root and boot filesystem for a server.
I think a power outage occurred (another colocated server with a similar usb stick also crashed, but fsck was able to repair the partitions there).
For the usb stick in question:
fdisk and gpart can read it and show the partitions correctly. Mounting is not possible of any partition. booting from it also fails. ddrescue copied the whole stick without any errors.
On the image again, fdisk and gpart work flawlessly, only interacting with the partitions doesn't work.
What I've done so far:
This is the physical device, camcontrol and usbconfig see it:
Also the partition table seems to be intact and the special files in /dev are also there:
Mounting however fails:
I've created an image of it with ddrescue and created a memory disk on it. For that the information shown above is completely the same. And also the error at mounting.
I've also tried to create a NOP GEOM, but that also didn't help (but i'm unsure if I calculated the offset correctly, Hints in that direction are also very welcome)
dumpfs and fsck_ufs also fails:
How do I continue?
I think a power outage occurred (another colocated server with a similar usb stick also crashed, but fsck was able to repair the partitions there).
For the usb stick in question:
fdisk and gpart can read it and show the partitions correctly. Mounting is not possible of any partition. booting from it also fails. ddrescue copied the whole stick without any errors.
On the image again, fdisk and gpart work flawlessly, only interacting with the partitions doesn't work.
Bash:
root@matzenas:/dev # uname -a
FreeBSD matzenas 12.1-RELEASE-p1 FreeBSD 12.1-RELEASE-p1 GENERIC amd64
What I've done so far:
This is the physical device, camcontrol and usbconfig see it:
Code:
root@matzenas:/dev # dmesg | grep ^da1
da1 at umass-sim1 bus 1 scbus7 target 0 lun 0
da1: <SanDisk Ultra 1.00> Removable Direct Access SPC-4 SCSI device
da1: Serial Number 4C530001091102122154
da1: 40.000MB/s transfers
da1: 29328MB (60063744 512 byte sectors)
da1: quirks=0x2<NO_6_BYTE>
root@matzenas:/dev # camcontrol devlist | grep ,da1
<SanDisk Ultra 1.00> at scbus7 target 0 lun 0 (pass5,da1)
root@matzenas:/dev # usbconfig | grep ugen0.4
ugen0.4: <SanDisk Ultra> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (224mA)
Also the partition table seems to be intact and the special files in /dev are also there:
Code:
root@matzenas:/dev # fdisk /dev/da1
******* Working on device /dev/da1 *******
parameters extracted from in-core disklabel are:
cylinders=3738 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=3738 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 238 (0xee),(EFI GPT)
start 1, size 60063743 (29327 Meg), flag 0
beg: cyl 0/ head 0/ sector 2;
end: cyl 1023/ head 255/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
root@matzenas:/dev # gpart show /dev/da1
=> 40 60063664 da1 GPT (29G)
40 1024 1 freebsd-boot (512K)
1064 56622080 2 freebsd-ufs (27G)
56623144 3002368 3 freebsd-swap (1.4G)
59625512 438192 - free - (214M)
root@matzenas:/dev # ls -l da1*
crw-r----- 1 root operator 0x70 1 März 12:21 da1
crw-r----- 1 root operator 0x72 1 März 12:21 da1p1
crw-r----- 1 root operator 0x73 1 März 12:21 da1p2
crw-r----- 1 root operator 0x75 1 März 12:21 da1p3
Mounting however fails:
Code:
root@matzenas:/dev # mount /dev/da1p1 /mnt/
mount: /dev/da1p1: No such file or directory
root@matzenas:/dev # mount /dev/da1p2 /mnt/
mount: /dev/da1p2: No such file or directory
root@matzenas:/dev # mount /dev/da1p3 /mnt/
mount: /dev/da1p3: No such file or directory
I've created an image of it with ddrescue and created a memory disk on it. For that the information shown above is completely the same. And also the error at mounting.
Code:
root@matzenas:~ # ddrescue /dev/da1 da1_rescue.img da1_rescue.log
root@matzenas:~ # mdconfig -a -t vnode -u 0 -f da1_rescue.img
I've also tried to create a NOP GEOM, but that also didn't help (but i'm unsure if I calculated the offset correctly, Hints in that direction are also very welcome)
Code:
root@matzenas:/dev # gnop create -o 512K md0
dumpfs and fsck_ufs also fails:
Code:
root@matzenas:/dev # dumpfs /dev/md0p1
dumpfs: /dev/md0p1: No such file or directory
root@matzenas:/var # fsck_ufs /dev/md0p1
Can't open /dev/md0p1: No such file or directory
root@matzenas:/var # fsck_ufs /dev/md0p2
Can't open /dev/md0p2: No such file or directory
root@matzenas:/var # fsck_ufs /dev/md0p3
Can't open /dev/md0p3: No such file or directory
How do I continue?