Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increasing file space 4

Status
Not open for further replies.

agape234

Programmer
Oct 10, 2001
128
US
I have a Solaris 9 platform. Up and running with default files system(s) config. This is in use so I cannot rebuild and adjust root, var or usr. I need to increase these file systems. At present all are under root. Also I have added a second hard drive and want to link /opt to that new drive so I can install some apps. /opt is the default install location for the app. What is the process for linking /opt to a new disc location. And increase the file system size for root, /var and /usr. These are some pretty basic skills for a SysAdmin but I am trying to refresh these skills after years of sleeping!!!

Thanks
 
Agape234,
Since you can not shut down and rebuild your server, you could look into Raid 0 (Concatenation). This would give you the ability of increasing the root file system on the fly.

If you want to add apps from your 2nd hard drive to the /opt directory, create a mount point under /opt and mount the 2nd hard drive partition to that mount point.

Example:
cd /opt
mkdir newapps
mount /dev/dsk/c#T#D#s# /opt/newapps

 
OK thanks.
What are the steps if I want to mount the entire /opt to the new disc? How can I expand root, /var and /usr on the fly. Or if anyone could recommend a good book that outlines these sort of tasks that would be excellent as well. I have 3 or 4 books (Sol 7) but none offer this type of info. Will growfs work in this instance?
 
growfs... Geeze.. I forgot about that command. I'll look into it and let you know.

To move the entire /opt directory.

Mount the new /opt partition to /mnt:
# mount /dev/dsk/c#t#d#s# /mnt
# cd /opt
# tar -cvfp /mnt/opt.tar *
# cd /mnt
# tar -xvf opt.tar
# rm opt.tar
# umount /mnt

Now the following commands will temporarily take the /opt off line.

# unshare /opt
# umount /opt

Edit your /etc/vfstab to change the partition entries for /opt.

# mountall
# shareall

You should be ready to go.
 
before you tar the /opt dic be sure that you got enough space or try something lite this:

tar -cvfp /opt/* | tar -xvf /mnt
 
ZilSwe.
I understand what you are saying. Your command will work but when extracted, all the files will be under /mnt/opt. When you mount the partition, all the files will be under /opt/opt
 
The concern that ZilSwe has brought up is the commands that I posted could cause space problems. If you follow what I wrote, you would need at least 2X the space in your new /opt partition than what exists in the old /opt partition.
 
I thought growfs was applicable only to SDS metadevices, but I could be wrong.
 
Raid 0 is not good though if he loses a hard drive then all of his data will also be lost, that is one thing to consider. If I remember correctly I believe that / could not be grown using growfs, even if it was under SDS control. I would just stick with moving /opt until he can get some downtime to move those also.
 
I agree with Coffeysm, but would add that I successfully used growfs to grow a / filesystem on one occasion, whilst keeping fingers and eyes crossed and it worked. I wouldn't like to do it every day though!
 
I agree Coffeysm... I was just trying to find a solution for the existing senario..
 
Thanks to all. Combined info provides good view of solution options.....
 
bfitz I was not exactly knocking your solution. It's just I have had first hand experience of a Raid 0 going down and let me tell you it SUCKS!!! The previous admin before me set it up as Raid 0 and it crashed on me on 4th of July weekend. So I spent the entire time rebuilding the 1TB file system over to Raid 5. Needless to say I was not very happy about that occurring. I would do solution similar to Zfilwe's but I would change the following:

I would setup a slice on the separate hard drive for /opt.

mount /dev/dsk/your_slice /mnt
cd /opt

I think this command might work been awhile since I used it. It is kind of like Zfil's but will cd into the directory and tar and untar it at the same time. I think there is an example on man tar.

tar -cvpf . |(cd /mnt ; tar -xvpf -)
 
Agape234... I hope our discussion didn't create confusion. As coffeysm has pointed out, Raid 0 has no failover. When you get the chance to take down your system and rebuild it, you may want to look into some kind Raid solution. If you need any assistance, give a post. There are a lot of good admins here.

Thank-you for the Star...
 
OK, the /opt now occupies a drive on it's own. Seems to be fine. However, / is sitting at 68%. /var and /etc are not seperated out. How do I increase / quickly. If I move /var and /etc into their own mnt will that take care of it? What steps do I need to increase this space?
 
I don't think 68% is too bad for root, even if it does include /var. You could just monitor /var to ensure it's logs etc don't get too large and prune them when they are approaching a pre-determined size. I wouldn't move /etc anywhere in any case.
 
As Ken mentioned 68% is not bad for root. However, you would want to move /var to it's own partition. Do you have any additional room on the hard drive that you moved /opt to? or any unassigned space on the hard drive that / is on?

Resume online at:
 
I have room on either drive for some, more on the second w /opt. Just as a what if, I could take a weekend and rebuild the box from scratch and customize the file system at installation. Any tips on this process? /; /var; and /etc file system sizes etc. These systems have been purchased for my group and usually come fully ready to play, but sometimes the applications require us to tweak the OS, but not often enough for me to be considered a SOL admin obviously......
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top