Short tutorial on how to connect, format, mount, detach and reconnect external USB disks.
The used disk is WD20EARS connected to a USB port via Sharkoon Quickport Pro cradle.
Basically, you need only two commands:
- rmformat – to determine the device name/path
- zpool – to do the rest (create ZFS, mount, attach and detach)
To show the connected disk use cfgadm, rmformat and format -e:
usb4/3 usb-hub connected configured ok
usb4/3.1 usb-device connected configured ok
usb4/3.4 usb-storage connected configured ok
xeon% rmformat
. . .
4. Logical Node: /dev/rdsk/c4t0d0p0
Physical Node: /pci@0,0/pci1043,81dc@1d,7/hub@3/storage@1/disk@0,0
Connected Device: Generic External 2.10
Device Type: Removable
Bus: USB
Size: 1907,7 GB
Label:
Access permissions: Medium is not write protected.
xeon# format -e
Searching for disks…done
. . .
5. c5t0d0
/pci@0,0/pci1043,81dc@1d,7/hub@3/storage@1/disk@0,0
To create amd mount ZFS use zpool:
xeon# zpool create usbpool /dev/dsk/c5t0d0p0
xeon# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
. . .
usbpool 1,81T 76,5K 1,81T 0% ONLINE –
xeon# zfs list
NAME USED AVAIL REFER MOUNTPOINT
. . .
usbpool 72K 1,78T 21K /usbpool
xeon# zpool status
pool: usbpool
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
usbpool ONLINE 0 0 0
c5t0d0p0 ONLINE 0 0 0
errors: No known data errors
To unmount/disconnect the disk:
xeon# zpool export usbpool
xeon# zfs list
…
Now the USB disk can be physically disconnected and removed. To reconnect/remount it again:
pool: usbpool
id: 2596265792711863797
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
usbpool ONLINE
c5t0d0p0 ONLINE
xeon# zpool import usbpool
xeon# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
usbpool 1,81T 78K 1,81T 0% ONLINE –
# zpool import usbpool
# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
rpool 464G 204G 260G 44% ONLINE –
usbpool 1,81T 80K 1,81T 0% ONLINE –