Monthly Archives: March 2007

Howto resize or shrink UFS partitions

A friend of mine asked me the other day if there was such a thing as Partition Magic for Solaris. Apparently, someone had installed a system on a single slice and they’re security team was requiring a separate partition for the DB.

Here are the givens:

  • Sunfire V210
  • Solaris 8 (Otherwise we’d be using zfs)
  • 2 73GB disks
  • 1 slice on disk1
  • Disk 2 is supposed to be a mirror of disk 1 but it isn’t used yet
  • Downtime is allowed
  • Reinstalling is not an option

I personally don’t know of any tool that lets you shrink UFS partitions but that doesn’t mean that we can’t perform some Partition Magic of our own.

NOTE:
I have not tested this procedure. I think it is logical and should work and it should do no harm as the first disk remains fully intact.

  1. Go into single user mode
  2. Partition the second disk as required.
  3. newfs the partitions on the second disk
  4. Mount the second disk’s partitions
  5. Use ufsdump/ufsrestore to copy the filesystem into it’s smaller home

    ufsdump 0f - / | ( cd /mnt/newroot ;ufsrestore xvf - )

  6. When all the partitions are done, use installboot to make the second disk bootable.

    installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t2d0s0

  7. Shutdown the system, physically swap the disks, and do a reconfiguration reboot.

If rebooting goes smoothly, test your new system thoroughly and then build your mirrors.

Solaris 10 doesn’t find network card

I recently installed Solaris 10 06/06 x86 on my desktop machine, a Compaq Evo with an onboard Intel 10/100 network card.

At first the Solaris installation seemed to hang while trying to find a network configuration from a non-existant RPC boot server. In retrospect, I think the problem was that Solaris didn’t find an appropriate driver for the card but after waiting a long time, the installation continued skipping the network configuration.

Running prtconf -pv shows the pci identification details for the ethernet card:

model: ‘Ethernet controller’
power-consumption: 00000001.00000001
fast-back-to-back:
devsel-speed: 00000001
interrupts: 00000001
max-latency: 00000038
min-grant: 00000008
subsystem-vendor-id: 00000e11
subsystem-id: 00000012
unit-address: ‘8’
class-code: 00020000
revision-id: 00000081
vendor-id: 00008086
device-id: 0000103b
name: ‘pcie11,12’

Looking up the identification information in the PCI ID repository tells me I’m dealing with a 82801DB PRO/100 VM (LOM) Ethernet Controller

Looking at /boot/solaris/devicedb/master, I found the following similar drivers:

bash-3.00# grep 82801DB /boot/solaris/devicedb/master
pci8086,1039 pci8086,1039 net pci iprb.bef “Intel 82801DB Ethernet 82562ET/EZ PHY”
pci8086,103d pci8086,103d net pci iprb.bef “Intel 82801DB PRO/100 VE Ethernet”

Both cards use the iprb driver so I add the identifier for my driver into /etc/driver_aliases:

iprb “pci8086,1038”
iprb “pci8086,1039”
iprb “pci8086,103b”
iprb “pci8086,103d”

Load the driver with the modload command and plumb the interface:

modload /kernel/drv/iprb
ifconfig iprb0 plumb

If that works, create the /etc/hostname.iprb0 file. I wanted to use DHCP so I did the following:

touch /etc/dhcp.iprb0
touch /etc/hostname.iprb0

Then do a reconfigure reboot.