Link to home
Start Free TrialLog in
Avatar of huffmana
huffmanaFlag for United States of America

asked on

Increase root partition size ????

Hi, I have inherited a Solaris 9 machine that is a production server and has applications running (most likely from /usr/local but there is also /home/msql).  This machine was built with a small root, swap and a BIG /export/home, and that is all.  I have already transitioned /export/home to another disk (the second disk was not being used!!) so there is a lot of space available on the boot disk.

HELP, how can I add more space to root with the least amount of down time ?

growfs is metadisk only and will not work with root anyway.  

I was thinking about making a UFSDUMP -> format -> UFSRESTORE but the maching will be offline for longer than I like (it is in a 27/7 environment).  If I did have to do this, can I move /dev, /var and /usr to a new partitions without messing up pointers and stuff ?

Many Thanks, Allan    
SOLUTION
Avatar of PsiCop
PsiCop
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of huffmana

ASKER

Thanks fellow admins :-)  What I thought was an option for changing partition size was, after closer inspection, was Veritas.

And yes, you would think that people would think to have a spare and identical server for each "mission critical system" and spare disks for testing and practicing backups, system updates, reconfigurations, and easy switch over.  Especially since these are only Nextra 210 and 240 !  But no, we have 2 spare 210s each with 1 36GB disk !!  Can't even build up the RAID1 on the correct disks on a spare machine.  I always wanted to rebuild a Metadisk server using ufsdump, but the identical disks are needed....

Since I am not a good judge of comments I'll split the points evenly but I like the comment about chicken-n-egg scenario so I'll select that one.  Thank you both very much, I wish that I could select multiple responses for the answer.

Best Allans
Look what I just found:
 /usr/sbin/static/mv:    ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped

I just tested it and it works well from $HOME...

Here is a partition copy script I found for moving root and var.  (I guess that the boot disk has to be changed in eeprom and an "installboot bootblk" done to c0t1d0s0 to switch to the second disk...)  Looks like the script is ran form "boot cdrom -s"

http://sysunconfig.net/unixtips/poor_mans_mirror.dump.txt
-------------------------------------
#!/bin/ksh
# Mount the c0t1d0 partitions so we can do the ufsdump...
cd /
mount /dev/dsk/c0t1d0s0 /mnt
mount /dev/dsk/c0t1d0s5 /var1
# Begin the ufsdump sequence...
    echo "Starting copy of disk c0t0d0 to c0t1d0 at `date`."
    echo "Doing root partition first... mount point used is /mnt"
cd /
ufsdump 0f - /dev/rdsk/c0t0d0s0 | (cd /mnt ; ufsrestore xf -)
    echo "...root partition done."
    echo "Doing var partition... mount point used is /var1"
ufsdump 0f - /dev/rdsk/c0t0d0s5 | (cd /var1 ; ufsrestore xf -)
    echo "...var partition done."
    echo "Disk copy complete at `date`."
WOW, a co-worker here, Andy, found a command that will expand the size of a mounted or unmounted partition keeping the original filesystem intact :-)

 1) Determine the sector / cylinder count for the disk where the partition is located.
  # prtvtoc /dev/rdsk/c#t#d#c#
2) Use format and label to increase the size of the partition in the super-block.
  * There must be contiguous space available directly following the end of the partition.
3) for mounted partitions use:
  # /usr/lib/fs/ufs/mkfs -G -M  /mount_point /dev/rdsk/c#@t#d#s#  nnnn
      nnnn = absolute size in sectors
4) for un-mounted partition use:
    # /usr/lib/fs/ufs/mkfs -G  /dev/rdsk/c#@t#d#s#  nnnn
      nnnn = absolute size in sectors

We tested it and it worked find under Solaris 9 but note that this is not documented by Sun.  These are the commands used for the Veritas growfs command.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I agree. There are a number of features in Solaris 9 that were not available or backported to Solaris 8. The fact that it worked in Solaris 9 doesn't mean a thing for Solaris 8.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes I agree about the mirror.  Other machines here have a full mirror including root.  I understand that this machine is some kind of test machine but it has a production application...  I know nothing !!!

But this leads me to another question that I wanted to ask.  Some of the machines look like this:
#
/dev/md/dsk/d3  -                         -        swap    -       no      -
/dev/md/dsk/d0  /dev/md/rdsk/d0 /           ufs       1        no      logging
swap                 -                          /tmp    tmpfs   -       yes     -
/var/newswap   -                         -         swap    -       no       -

Note the tmpfs !  I have never used a tmpfs before but most Internet references that I find say that it is only useful for some database apps.  But since the real swap disk space is mirrored ( adding a performance reducing layer above th filesystem ), perhaps there is a performance advantage?

Anyone have experience with tmpfs and can say if they are useful ?
Oh, BTW, we have asked to bring the system down to do a UFSDUMP before we do anything.  And the disk grow will be done from "boot cdrom -s."  You see I am taking some precautions ;-/
Avatar of yuzh
yuzh

>>Note the tmpfs !  
tmpfs -- the temporary file system -- caches writes only for a session. Files are not preserved across operating system reboots.

It is the swap space you allocated when you perform the OS installation, you use it all the time!

>/var/newswap  
is an add on swap file, type in "swap -l" you'll see what I mean.

Have a nice weekend, cheers!
Oh yeah, just used only 10 GB of the second disk for /export/home in partition 4 so it will be possible to move other filesystems to disk:b.  

But speaking of mirrored root.  In the Solaris 7 days, I had a mirrored root and a disk failed.  As I understood, there has to be a little more than 1/2 of the metadb available to boot, and since it is only a mirror, how can there be more than 1/2 of the metadb available ?  As a result, once shutdown, the system would not reboot.  Is this still a problem with mirrored root  filesystems ?  Come to think of it, I did not add a bootblk to disk:b and change the eeprom disk:b ?

I you prefer that I open another question for each of these add-on topics, let me know.                          Best Allan
For disk mirroring, you need to have a small partition (slice)
about 15-20mb to store the metadb.

Please have a look at the procedures in the following page
to learn how:
http://slacksite.com/solaris/disksuite/disksuite.html

and
http://www.idevelopment.info/data/Unix/Solaris/SOLARIS_CreateVolumes_VolumeManager9Commands.shtml

PS: Solaris 9 has Volume Manager installed by default, the
commands are the same as DiskSuite for Solaris 8.

You need to repartition your hard disk first, and remember to keep a 15-20mb partion for the metadb.

When you are happy with the partitions, you can then go ahead to do setup the mirror root disk.

I'll get back to you if this one still open early next week if it still open.

Good night and have a nice weekend to all of you, cheers!