[geeks] Sun file system problem

Jonathan C. Patschke jp at celestrion.net
Wed Jun 12 10:20:57 CDT 2002


On Wed, 12 Jun 2002, Michael A. Turner wrote:

> # df -k
> /dev/dsk/c0t1d0s0    1758462  650659 1055050    39%    /
> /dev/dsk/c0t3d0s6    1506815  182793 1263750    13%    /cache
> /dev/dsk/c0t3d0s7     365047  237646   90897    73%    /var/opt/Mail-Gear
> 
> 	I just got through cleaning the /var/opt/Mail-Gear, that is why it
> has 90 megs free. Now what I would like to do. The cache partion hardly gets
> used at all so I want to move free space to the mail-gear partion (I know
> that is a crude way of saying it but it makes the most sense to me :-) ).
> How do I do that, can I do that? how dangerous is it? Is their any way to
> repartion a drive without wiping out the contents of the partions involved?
> inquiring minds want to know.... 

What I would do is:
  1) Bring the system down to single-user.
  2) Perform level 0 ufsdumps of /cache and /var/opt/Mail-Gear into
     archives in / (since / has oodles of free space).
  3) Unmount /cache and /var/opt/Mail-Gear.
  4) Switch the /etc/vfstab entries for /cache and /var/opt/Mail-Gear
  5) newfs /dev/dsk/c0t3d0s6 and /dev/dsk/c0t3d0s7.
  6) Mount the new /cache and /var/opt/Mail-Gear.
  7) ufsrestore the archives into their respective directories.
  8) Bring the system up to multiuser
  9) Verify operation and delete the two archive files in / AFTER you're
     sure that everything's working.

This will effectively swap the two slices, giving you 1.4GB for
/var/opt/Mail-Gear and 356.5MB for /cache.

But, to answer the question you actually asked: No, there is no
nonedestructive way to shrink a UFS slice and move that space over to
another slice.  This is both due to there being no way (to my knowledge)
to shrink UFS file systems slices, and that slices must consist of a
contiguous group of cylinders.  So, at the very least, you'd need to use
DiskSuite to concatenate the slices, unless you wanted to remove -both- of
them and recreate them to be the sizes you want.  In any case, you're left
needing to back up & restore data.

--Jonathan



More information about the geeks mailing list