You are viewing a read-only archive of the Blogs.Harvard network. Learn more.
Skip to content

FreeBSD USB Hard Disk HOW-not TO

I picked up a shiny new 160 gig drive to replace the current drive in the
server. The old approach to backup was something like this:

General Steps for backing up data partition

(Note: not exact steps)

  1. Power Down Server
  2. Insert new disk drive on a free IDE bus
  3. Setup new hard disk to be able to used in FreeBSD

    bsdlabel -w ad2
    newfs ad2

  4. Mount new hard disk to be able to copy things onto it

    mount /dev/ad2 /mnt/temp
  5. Dump data partition into new hard disk:
    ( dump -0f – /home ) | ( cd /mnt/temp ; restore -rf – )
  6. Power Down Again
  7. Swap hard drives
  8. Power up again, Done

Of course, snags always came up during that process but the main problem for
me is the Power Down phase. The server is just down for too long during the
dump session for my tastes. These days things are much easier with mass
storage devices for USB and Firewire. Just plug one of these babies in
and dump away. With the faster throughput of USB2.0 or Firewire, the finger
tapping has decreased somewhat. The MAJOR increase in storage capacity has
helped bring back up the wait times that the throughput increase would have
decreased.

I took my shot at using a USB HDD enclosure on the hard drive and plugging
it into FreeBSD. In the dmesg I saw a umass0 detected message but according
to the docs you should also be seeing a SCSI direct access drive.

Example da device detection (working case):

umass0: [Manufacturer shows up here]
da0 at umass-sim0 bus 0 target 0 lun 0
da0: Fixed Direct Access SCSI-0 device
da0: XX.000MB/s transfers
da0: YYYYYYMB (78125000 512 byte sectors: 255H 63S/T 4863C)

I saw only the umass0 message. After scritching my head why I saw no
da0 for awhile I realized something.

Support for USB HDD enclosures is heavily device driver dependent

aka. you can’t just buy any generic USB HDD enclosure and expect it to work.
I’d suggest reading the manpage for the
umass(4)
storage driver to ensure you have a compatible USB storage device. Needless
to say, the HDD enclosure I have (A DECA
SDHC-350) does not seem to be compatible with FreeBSD 5.4-STABLE at this time.

How I fixed it

I swapped to a IEEE1394 HDD enclosure I owned and the HDD came up perfectly
and was detected as da0 on my system. I then ran through the general backup
steps above to backup my system.

One thing I should add to the general steps is to create a very ‘basic’
FreeBSD installation on a small BSD slice on the data drive. With disk
space very cheap these days using up 1gig for a partition that can bootup
a minimal RELEASE or preconfigured setup is awfully handy when your system
drive takes a dive.

References

FreeBSD umass manpage
Encrypted Filesystem on a USB Thumbdrive
How to move FreeBSD to a new hard disk
How can I mount this device: da0

Be Sociable, Share!

{ 1 } Comments