disklabel/scan_ffs
Hi, I have a hard drive that crashed in some way or the other, and I'd like to see if I can access it, and ideally retrieve some of the files. I've connected it to a USB-bridge, but I fear it is beyond repair as it gets an error when I try to do disklabel: # disklabel sd1disklabel: ioctl DIOCGDINFO: Input/output error I also tried scan_ffs in different ways:# scan_ffs /dev/rsd1c scan_ffs: read: Input/output error# scan_ffs /dev/sd1c scan_ffs: /dev/sd1c: No medium found # scan_ffs /dev/sd1 scan_ffs: /dev/sd1: No such file or directory # scan_ffs /dev/sd1a scan_ffs: /dev/sd1a: No medium found # scan_ffs /dev/rsd1a scan_ffs: /dev/rsd1a: No medium found -Should I just give up, or are there other options? Some info:# sysctl hw.disknameshw.disknames=sd0:1ea2ee1a14a6352d,cd0:,sd1: # dmesg OpenBSD 5.6 (GENERIC.MP) #299: Fri Aug 8 00:10:33 MDT 2014 dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP cpu0: Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz (GenuineIntel 686-class) 1.29 GHz cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,V MX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,LAHF,PERF real mem = 3745349632 (3571MB) avail mem = 3671699456 (3501MB) mpath0 at root scsibus0 at mpath0: 256 targets mainbus0 at root bios0 at mainbus0: AT/286+ BIOS, date 08/11/09, BIOS32 rev. 0 @ 0xffa10, SMBIOS rev. 2.4 @ 0xf67a0 (55 entries) bios0: vendor Dell Inc. version A07 date 08/11/2009 bios0: Dell Inc. Precision M6400 acpi0 at bios0: rev 2 acpi0: sleep states S0 S3 S4 S5 acpi0: tables DSDT FACP HPET DMAR APIC ASF! MCFG TCPA SLIC SSDT acpi0: wakeup devices PCI0(S5) PCIE(S4) USB1(S0) USB2(S0) USB3(S0) USB4(S0) USB5(S0) USB6(S0) EHC2(S0) EHCI(S0) AZAL(S3) RP01(S4) RP02(S4) RP03(S4) RP04(S3) RP05(S3) [...] acpitimer0 at acpi0: 3579545 Hz, 24 bits acpihpet0 at acpi0: 14318179 Hz acpimadt0 at acpi0 addr 0xfee0: PC-AT compat cpu0 at mainbus0: apid 0 (boot processor) mtrr: Pentium Pro MTRR support, 7 var ranges, 88 fixed ranges cpu0: apic clock running at 266MHz cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE cpu1 at mainbus0: apid 1 (application processor) cpu1: Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz (GenuineIntel 686-class) 2.80 GHz cpu1: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,LONG,SSE3,DTES64,MWAIT,DS-CPL,V MX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,LAHF,PERF ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins ioapic0: misconfigured as apic 0, remapped to apid 2 acpimcfg0 at acpi0 addr 0xf800, bus 0-63 acpiprt0 at acpi0: bus 3 (PCIE) acpiprt1 at acpi0: bus 1 (AGP_) acpiprt2 at acpi0: bus 11 (RP01) acpiprt3 at acpi0: bus 12 (RP02) acpiprt4 at acpi0: bus 13 (RP03) acpiprt5 at acpi0: bus 14 (RP04) acpiprt6 at acpi0: bus 16 (RP05) acpiprt7 at acpi0: bus 9 (RP06) acpiprt8 at acpi0: bus 0 (PCI0) acpiec0 at acpi0 acpicpu0 at acpi0: C3, C2, C1, PSS acpicpu1 at acpi0: C3, C2, C1, PSS acpitz0 at acpi0: critical temperature is 107 degC acpibtn0 at acpi0: LID_ acpibtn1 at acpi0: PBTN acpibtn2 at acpi0: SBTN acpiac0 at acpi0: AC unit online acpibat0 at acpi0: BAT0 model DELL H355F8A serial 10297 type LION oem Samsung SDI acpivideo0 at acpi0: VID_ acpivout0 at acpivideo0: LCD_ bios0: ROM list: 0xc/0xe000 0xce000/0x2000 cpu0: Enhanced SpeedStep 2794 MHz: speeds: 2801, 2800, 2134, 1600 MHz pci0 at mainbus0 bus 0: configuration mode 1 (bios) pchb0 at pci0 dev 0 function 0 Intel Q45 Host rev 0x03 ppb0 at pci0 dev 1 function 0 Intel Q45 PCIE rev 0x03: apic 2 int 16 pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 vendor NVIDIA, unknown product 0x063a rev 0xa1 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) uhci0 at pci0 dev 26 function 0 Intel 82801I USB rev 0x02: apic 2 int 20 uhci1 at pci0 dev 26 function 1 Intel 82801I USB rev 0x02: apic 2 int 21 uhci2 at pci0 dev 26 function 2 Intel 82801I USB rev 0x02: apic 2 int 22 ehci0 at pci0 dev 26 function 7 Intel 82801I USB rev 0x02: apic 2 int 22 usb0 at ehci0: USB revision 2.0 uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1 azalia0 at pci0 dev 27 function 0 Intel 82801I HD Audio rev 0x02: msi azalia0: codecs: IDT 92HD71B7 audio0 at azalia0 ppb1 at pci0 dev 28 function 0 Intel 82801I PCIE rev 0x02: apic 2 int 16 pci2 at ppb1 bus 11 ppb2 at pci0 dev 28 function 1 Intel 82801I PCIE rev 0x02: apic 2 int 17 pci3 at ppb2 bus 12 Broadcom BCM4313 rev 0x01 at pci3 dev 0 function 0 not configured ppb3 at pci0 dev 28 function 2 Intel 82801I PCIE rev 0x02: apic 2 int 18 pci4 at ppb3 bus 13 ppb4 at pci0 dev 28 function 3 Intel 82801I PCIE rev 0x02: apic 2 int 19 pci5 at ppb4 bus 14 re0 at pci5 dev 0 function 0 Realtek 8168 rev 0x06: RTL8168E/8111E-VL (0x2c80), msi, address 00:13:3b:85:05:69 rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 5 ppb5 at pci0 dev 28 function 4
Re: disklabel/scan_ffs
On Mon, Aug 11, 2014 at 12:36:35PM -0400, Stefan Olsson wrote: Hi, I have a hard drive that crashed in some way or the other, and I'd like to see if I can access it, and ideally retrieve some of the files. I've connected it to a USB-bridge, but I fear it is beyond repair as it gets an error when I try to do disklabel: # disklabel sd1disklabel: ioctl DIOCGDINFO: Input/output error I also tried scan_ffs in different ways:# scan_ffs /dev/rsd1c scan_ffs: read: Input/output error# scan_ffs /dev/sd1c scan_ffs: /dev/sd1c: No medium found # scan_ffs /dev/sd1 scan_ffs: /dev/sd1: No such file or directory # scan_ffs /dev/sd1a scan_ffs: /dev/sd1a: No medium found # scan_ffs /dev/rsd1a scan_ffs: /dev/rsd1a: No medium found -Should I just give up, or are there other options? Some info:# sysctl hw.disknameshw.disknames=sd0:1ea2ee1a14a6352d,cd0:,sd1: Have you tried sleuthkit? I've used it in the past but it was so long ago I can't quite remember what problem needed fixing, but IIRC it was for something similar to your problem and it did the job. Best of luck. --
Re: disklabel/scan_ffs
On 2014-08-11, Stefan Olsson stur...@hotmail.com wrote: Hi, I have a hard drive that crashed in some way or the other, and I'd like to see if I can access it, and ideally retrieve some of the files. I've connected it to a USB-bridge, but I fear it is beyond repair as it gets an error when I try to do disklabel: # disklabel sd1disklabel: ioctl DIOCGDINFO: Input/output error I also tried scan_ffs in different ways:# scan_ffs /dev/rsd1c scan_ffs: read: Input/output error# scan_ffs /dev/sd1c scan_ffs: /dev/sd1c: No medium found # scan_ffs /dev/sd1 scan_ffs: /dev/sd1: No such file or directory # scan_ffs /dev/sd1a scan_ffs: /dev/sd1a: No medium found # scan_ffs /dev/rsd1a scan_ffs: /dev/rsd1a: No medium found -Should I just give up, or are there other options? Some info:# sysctl hw.disknameshw.disknames=sd0:1ea2ee1a14a6352d,cd0:,sd1: What does 'fdisk sd1' say? Have you used this USB bridge before? Does it work with a known-good disk? FWIW (commercial software though), r-studio can read OpenBSD FFS. Might be worth a try with the demo of that if you have access to a (Windows|Mac|Linux) box to run it on.
Re: disklabel/scan_ffs
Bliss! -A simple power cycle while bridge was still connected with USB, woke the disk up! Both disklabel and fdisk worked fine on the disk after this and I've got my files. Before the powercycle I got same Input/output error from fdisk as from disklabel: # fdisk sd1 fdisk: DIOCGPDINFO: Input/output error fdisk: Can't get disk geometry, please use [-chs] to specify.
Rescuing a messed-up disklabel -- scan_ffs, etc.
Hi All, I am very pleased with the turn of events after I baked the disklabel on my OBSD partition. A toast to all the hard work put in by OBSD development team, and an offer for a free lunch/dinner/beer if you happen to be in this part of India (Pune, closer to Mumbai/Bombay). scan_ffs found all partitions, and I was successfully able to restore everything. So this is what happened: I was experimenting with boot loaders and finally settled on GRUB as it allowed me to boot both Win XP and OBSD on my IBM ThinkPad X201. I was booted into WinXP and was using whole disk encryption software. Apparently, this encryption software marked the OBSD partition to be encrypted as well (since it was visible through the Windows Volume Manager as valid partition). Sure, it did not bother to check if Windows filesystems were active, etc. To get out of that situation, I deleted this partition from Windows, and GRUB conked with Error 22 (okay, should have thought that earlier -- but dumb moments happen). Fortunately, all my data was backed up. I then booted into OBSD via the boot CD, and cleared the partition table as well (second dumbest moment). *poof* went away both operating systems. Now I had a laptop with clean partition table, but both OS'es intact. I wasn't worried to much since data was backed up, but was wary of setting up OBSD again (including mail, etc.). So... (1) I booted a live CD - MarBSD 5.1 (2) Ran scan_ffs on the drive as scan_ffs -l sd0. It found almost all partitions, but was confused between /var and swap (so /var appeared twice!). I mounted both, and found which one was /var (interestingly, the other partition had exactly same content as /var, except for one sasl2 directory, and difference in size). (3) Redirected the output to a file, to be used in setting up the disklabel. (4) Ran disklabel -e sd0, and added the output from scan_ffs, with best guesses for partition names. [read scan_ffs and disklabel manpages before this]. (5) Rebooted and checked if things were fine -- /bsd booted fine, - However, later while mounting filesystems it stopped with messages to the tune of cannot mount sd0k and sd0j, etc.) - These were not a part of the disklabel interestingly(!) (6) Rebooted via OBSD 5.1 into single user mode bsd -s (7) Mounted / manually, and fixed /etc/fstab with correct partition names. (8) Reboot, and success! Everything was as-is. The output of scan_ffs can be seen in this image: http://lh3.googleusercontent.com/-ln-xNFxx6WM/T-P6e4wgEMI/ApA/zygztOh6uR8/s720/scan_ffs.jpg Thanks OBSD team again. Appreciate all your efforts, and the terrific OS. Many lessons learnt as well! :-) -Amarendra
Re: Rescuing a messed-up disklabel -- scan_ffs, etc.
Oh, and I also did re-install grub as a last step. Now remains the task of getting back the Windows OS. :-) -Amarendra On Fri, Jun 22, 2012 at 10:26 AM, Amarendra Godbole amarendra.godb...@gmail.com wrote: Hi All, I am very pleased with the turn of events after I baked the disklabel on my OBSD partition. A toast to all the hard work put in by OBSD development team, and an offer for a free lunch/dinner/beer if you happen to be in this part of India (Pune, closer to Mumbai/Bombay). scan_ffs found all partitions, and I was successfully able to restore everything. So this is what happened: I was experimenting with boot loaders and finally settled on GRUB as it allowed me to boot both Win XP and OBSD on my IBM ThinkPad X201. I was booted into WinXP and was using whole disk encryption software. Apparently, this encryption software marked the OBSD partition to be encrypted as well (since it was visible through the Windows Volume Manager as valid partition). Sure, it did not bother to check if Windows filesystems were active, etc. To get out of that situation, I deleted this partition from Windows, and GRUB conked with Error 22 (okay, should have thought that earlier -- but dumb moments happen). Fortunately, all my data was backed up. I then booted into OBSD via the boot CD, and cleared the partition table as well (second dumbest moment). *poof* went away both operating systems. Now I had a laptop with clean partition table, but both OS'es intact. I wasn't worried to much since data was backed up, but was wary of setting up OBSD again (including mail, etc.). So... (1) I booted a live CD - MarBSD 5.1 (2) Ran scan_ffs on the drive as scan_ffs -l sd0. It found almost all partitions, but was confused between /var and swap (so /var appeared twice!). I mounted both, and found which one was /var (interestingly, the other partition had exactly same content as /var, except for one sasl2 directory, and difference in size). (3) Redirected the output to a file, to be used in setting up the disklabel. (4) Ran disklabel -e sd0, and added the output from scan_ffs, with best guesses for partition names. [read scan_ffs and disklabel manpages before this]. (5) Rebooted and checked if things were fine -- /bsd booted fine, - However, later while mounting filesystems it stopped with messages to the tune of cannot mount sd0k and sd0j, etc.) - These were not a part of the disklabel interestingly(!) (6) Rebooted via OBSD 5.1 into single user mode bsd -s (7) Mounted / manually, and fixed /etc/fstab with correct partition names. (8) Reboot, and success! Everything was as-is. The output of scan_ffs can be seen in this image: http://lh3.googleusercontent.com/-ln-xNFxx6WM/T-P6e4wgEMI/ApA/zygztOh 6uR8/s720/scan_ffs.jpg Thanks OBSD team again. Appreciate all your efforts, and the terrific OS. Many lessons learnt as well! :-) -Amarendra