13 October 2009

Add an external USB disk to solaris (x86)

These are the steps I took to add an external USB disk to my x86 Solaris station, partition it and put ufs filesystems on it.

  • Tell the removable volume manager to leave USB disks alone

    • edit /etc/vold.conf

      # commented the following line
      # use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d

    • Activate the configuration change

      # svcadm refresh volfs


  • attach the USB drive
  • lookup the USB device name

    # rmformat
    Looking for devices...
         1. Volmgt Node: /vol/dev/aliases/cdrom0
            Logical Node: /dev/rdsk/c0t0d0s2
            Physical Node: /pci@0,0/pci-ide@6/ide@0/sd@0,0
            Connected Device: LITE-ON  DVD SOHD-16P9S   F3S2
            Device Type: DVD Reader
         2. Logical Node: /dev/rdsk/c2t0d0p0
            Physical Node: /pci@0,0/pci108e,5347@2,1/storage@4/disk@0,0
            Connected Device: ST316021 2A               0000
            Device Type: Removable

  • Solaris x86: create a Solaris fdisk partition on the device

    # fdisk -B /dev/rdsk/c2t0d0p0

  • Partition the drive. The format expert option is needed for the drive to show up:

    # format -e
    Searching for disks...done

    AVAILABLE DISK SELECTIONS:
           0. c1t0d0 <DEFAULT cyl 9726 alt 2 hd 255 sec 63>
              /pci@0,0/pci108e,5347@7/disk@0,0
          1 . c2t0d0 <DEFAULT cyl 19454 alt 2 hd 255 sec 63>
              /pci@0,0/pci108e,5347@2,1/storage@4/disk@0,0
    Specify disk (enter its number): 1
    ...

  • Now partition the drive.

    • Solaris x86: keep clear of cylinder0. It is in slice 8 and reserved for the VTOC and booting (grub).

  • create a file system on your partition(s) (I ignored the warning)

    # newfs /dev/rdsk/c2t0d0s0
    Warning: setting rpm to 60
    newfs: construct a new file system /dev/rdsk/c2t0d0s0: (y/n)? y
    ...

  • Add the file system to /etc/vfstab

    ...
    /dev/dsk/c2t0d0s0       /dev/rdsk/c2t0d0s0      / stuff      ufs     1       yes

  • mount the file system
# mount /stuff

No comments:

Post a Comment