Thursday, July 06, 2006

Using ZFS on an External USB HDD

Recently, I purchased an external USB hard drive for backups at home. Specificly, I purchased a Western Digital 120GB USB 2.0 drive. I hooked it up to my Ultra 60. I was not able to see the drive in format and even with vold turned off, I could not label the drive. However, with "format -e", I could atleast see the drive:

# format -e
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1f,4000/scsi@3/sd@0,0
1. c0t1d0
/pci@1f,4000/scsi@3/sd@1,0
2. c5t0d0
/pci@1f,4000/usb@5,2/device@2/storage@0/disk@0,0
Specify disk (enter its number):
The rmformat command displayed a little more info:

$ rmformat
Looking for devices...
1. Volmgt Node: /vol/dev/aliases/cdrom0
Logical Node: /dev/rdsk/c0t6d0s2
Physical Node: /pci@1f,4000/scsi@3/sd@6,0
Connected Device: TOSHIBA DVD-ROM SD-M1401 1007
Device Type: DVD Reader
Bus: SCSI
Size:
Label:
Access permissions:
2. Volmgt Node: /vol/dev/aliases/rmdisk0
Logical Node: /dev/rdsk/c5t0d0s2
Physical Node: /pci@1f,4000/usb@5,2/device@2/storage@0/disk@0,0
Connected Device: WD 1200BB External 0602
Device Type: Removable
Bus: USB
Size: 114.5 GB
Label:
Access permissions:
So, I decided to just create a ZFS pool called "usbstorage":

# zpool create usbstorage c5t0d0s2
# zpool list usbstorage
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
usbstorage 111G 24K 111G 0% ONLINE -
So that worked and I was able to create the file systems I wanted:

# zfs create usbstorage/backups
# zfs set mountpoint=/export/backups usbstorage/backups
# zfs set sharenfs=on rw usbstorage/backups
# share
- /export/backups rw ""
# df -h /export/backups
Filesystem size used avail capacity Mounted on
usbstorage/backups 109G 24K 109G 0% /export/backups
Pretty easy eh? I've already started to use this drive to backup my data. So far, the performance has been excellent. The next thing is to mount this share onto my iMac and backup my data:)