How to expand a Solaris system partion remotely

Posted on 2007-08-09
Last Modified: 2010-04-29
Need to expand a Solaris system partition remotely, without destoying the current install. I don't have physical access to this box.
Question by:Jim_Coyne
    LVL 16

    Expert Comment

    by:Hanno Schröder
    I need some more details:
    a) Are you talking about the system disk (which partition) or seom data partition?
    b) Is the partition on the system disk or on another disk?
    c) In the system itself or in some sort of external disk enclosure?
    d) What partitions are also on that disk?
    e) Do you (or can you) use a volume manager (VxVM or SVM)?
    LVL 14

    Expert Comment

    JustUnix has a lot of good questions, that may make a difference in the answer.

    But the bottom line is that it is not very likely that you will be able to expand a standard partition.

    The main reason is that there is not likely to be extra space to expand to, without adding disks.

    But, if the system was set up with metadisks, and you have unused slices, then you may be able to expand partitions.  
    It is a somewhat complicated process with a lot of preresquites, this page is a good explanation;

    If the system was not set up with metadisks, you can only expand a partition by creating a new partition and doing a copy and replacing the old partition, with the new larger one.

    Here is a rather novel way to do the copy and replace.

    The copy and replace cannot be done on a system partition, without a reboot.

    All standard warnings apply when working with disks in this manner.  You must backup all your data, since a single typo can destroy all your data...
    LVL 16

    Expert Comment

    by:Hanno Schröder
    Talking about expanding the system (boot or root) partition:
    You may be able to "steal" some space from your swap partition to grow into that space.
    If possible you can create some additional swap space somwhere else ;-)
    LVL 8

    Author Comment

    The system disk is 5Gb and is maxed, but the partition for /export/home is 58Gb. I want to shrink the the 58Gb a couple of gig and expand the system disk with that new space.
    LVL 14

    Accepted Solution

    Unless the partitions were set up using the meta disk stuff, you will not be able to do this.  
    This takes into account your initial parameters, no physical access to the disk, and not destroying the existing installation.

    There is an alternative, which is to find out why the system disk is maxed.  If someone has placed software in /opt on in /usr/local that may have contributed to the problem.

    But most likely, you have huge log files in /var/log and /var/adm and maybe a crash dump in /var/crash

    If you have large old log files, you could make a directory on the /export/home section and move the files to there.  And you can delete the files under /var/crash.

    You can do a;
    du -s
    from the root directory, this will tell you which directories use the space.

    For the record, this is one of the reasons why experienced admins build systems with separate partitions for / /usr /var and /opt  it makes it easier to tell where your resources are going, and it is easier to move and expand partitions when the root is not involved.
    LVL 16

    Assisted Solution

    by:Hanno Schröder
    If you want to shrink a partition, you will have to back it up, destroy it and recreate with smaller size.

    After that, you can either grow the existing root partition or add a second partition to it, forming a "concat".
    All you need to do this is SVM (Sun Volume Manager aka. SDS, Solstice Disk Suite).

    Better alternative would be to backup (ufsdump) all filesystems, recreate with the new required sizes and recover (ufsrestore) them.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. Please see for the updated article. It is avail…
    I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    This tutorial goes over how to archive and restore FreeBSD jails that are managed by ezjail.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now