# USB drive



## ReAX222 (May 31, 2011)

I made a backup of my laptop on a seagate external.  It was wiped clean before with dban so I used gpart to format and initialize it.  I killed the laptop working on it and I'd like to get into the back up now that the laptop is back running.

[CMD=]fdisk da1[/CMD]

```
****** Working on device /dev/da1 *******
parameters extracted from in-core disklabel are:
cylinders=9729 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=9729 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 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 156296322 (76316 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
```


```
HERA# gpart show
=>       63  312581745  ad4  MBR  (149G)
         63  312581745    1  freebsd  [active]  (149G)

=>        0  312581745  ad4s1  BSD  (149G)
          0    2097152      1  freebsd-ufs  (1.0G)
    2097152    8388608      2  freebsd-swap  (4.0G)
   10485760   14557184      4  freebsd-ufs  (6.9G)
   25042944    2097152      5  freebsd-ufs  (1.0G)
   27140096   83886080      6  freebsd-ufs  (40G)
  111026176  201555569      7  freebsd-ufs  (96G)

=>       34  156301421  da1  GPT  (75G)
         34  156301421    1  freebsd-ufs  (75G)
```
[CMD=]mount[/CMD] gives off this:

```
# mount /dev/da1 /mnt/backuphera
mount: /dev/da1 : Invalid argument
```
[cmd=]dmesg[/cmd]]

```
umass1: <Seagate ST94811U2-RK, class 0/0, rev 2.00/2.00, addr 2> on usbus7
umass1:  SCSI over Bulk-Only; quirks = 0x0000
umass1:1:1:-1: Attached to scbus1
da1 at umass-sim1 bus 1 scbus1 target 0 lun 0
da1: <ST380011 A 8.01> Fixed Direct Access SCSI-0 device 
da1: 40.000MB/s transfers
da1: 76319MB (156301488 512 byte sectors: 255H 63S/T 9729C)
WARNING: R/W mount of /media/disk denied.  Filesystem is not clean - run fsck
```
[cmd=]fsck da1[/cmd]

```
** /dev/da1
Cannot find file system superblock
ioctl (GCINFO): Inappropriate ioctl for device
fsck_ufs: /dev/da1: can't read disk label
```
I followed the handbook but have yet to get a resolution.  Is my data lost?


----------



## jb_fvwm2 (May 31, 2011)

I've often been in a similar situation, and that is why at least pre-v9-usb I tend to use gjournal filesystems to backup externally.  Usually, your data is recoverable with something like

```
mount -t ufs -o force /dev/... /mnt
```
 then you can copy the data off, though probably not put on a bsdlabel nor
fsck it. (Luck providing...) (Unsure of that exact syntax in this case, but it might work...) (Also complicated by the fact that I've never tried it on a GPT disk...)(...and you may need multiple mount statements for various filesystems there.)


----------



## wblock@ (May 31, 2011)

If the filesystem is on da1 rather than da1s1a, da1a, or da1p1, then there was a mistake when it was created.


----------



## Beastie (May 31, 2011)

wblock said:
			
		

> If the filesystem is on da1 rather than da1s1a, da1a, or da1p1, then there was a mistake when it was created.


Yes, but it's not uncommon. My "main" USB pendrive is "factory-partitioned" like that. And I've seen quite a few like this one. All others have an *s1* though.


----------



## ReAX222 (May 31, 2011)

I'm pretty sure I used da1p1 for the filesystem.  [CMD="mount /da1p1 ...."][/CMD] yielded the same results as I posted. It's my understanding of the gpart that the device name is the top level and then the 1 is the first indexed partition and it has a ufs filesystem.


----------



## ReAX222 (May 31, 2011)

```
mount -f /dev/da1p1 /mnt/backuphera
```
worked to force the mount, I can get there through dolphin's side bar, but it's not mounted to root like before.  It shows as empty too, but I had a back up of a project and ad4s1d backup.  So now that I'm this far, how do I recover atleast the folder with my project in it? Any good file recovery programs available?


----------



## jb_fvwm2 (Jun 1, 2011)

```
df
# /mnt or /mnt/something shows a filesystem?
# in an xterm btw
cd /mnt
find . -type f
```
Unclear whether your post above indicating find would not find anything, in this case whether find would actually see the files...in which case you could rsync them off AFAIK.


----------



## ReAX222 (Jun 1, 2011)

I was able to mount the disk.  It showed ~5.8gb were in use.  I ran Autopsy and it failed to locate any files on the disk.  I just tried it on a windows box with my old "file recovery pro" unfortunately neither windows nor the program would look at UFS, it didn't even give me an option for a physical drive.


----------

