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!

Root Partition not enough space 1

Status
Not open for further replies.

tubbycub

MIS
Feb 10, 2003
26
CN
Hi,

I have been trying to install some programs into Solaris 8 but it kept prompting that disk space is insufficient. Below are the disk info:

# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 1642971 1173959 419723 74% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
swap 1969608 0 1969608 0% /var/run
swap 1969624 16 1969608 1% /tmp
/dev/dsk/c0t0d0s7 14195375 9 14053413 1% /export/home


I realized that my root partition is nearly running out of space (at 74% capacity). Another finding is that /dev/dsk/c0t0d0s7 which was mounted on /export/home, has quite a lot of space.

This system is fresh from an initial (default) installation and nothing else has been installed yet.

So, how do I re-allocate the space in /dev/dsk/c0t0d0s7 to my root drive? Do I have to re-partition my harddisk? How do I do it?

Thanks in advance!
 
You do have to repartition. Easiest would be to reinstall and choose a different layout. Since you are putting /var and /opt on the root partition I would be fairly generous with the space allocation... say at least 4GB?
Annihilannic.
 
Hi Annihilannic,

Thanks again for helping.
The problem is that when I tried to install Solaris, there wasn't any option for me to select and configure partitions. How do I enable that?
 
Strongly recommend removing /var from /. Most logs are located in /var which may grow big fast. Too bad I.T. is not cash business

Luc Foata
Unix sysadmin, Oracle DBA
 
So how do I re-allocate disk space? I had reinstalled several times, both custom and default installation, but never once was I prompted to allocate disk space. I was only prompted to allocate for swap space.

I really need to take out the space from /export/home and transfer it to my root partition.

Also how to remove /var from / ?

Thanks
 
When you install Solaris even using default install, one screen 'Lay out file Systems' shows you the defaults the install program has decided (root & swap) - at this point select 'Modify' and add the extra filesystems you want (0 and 1 will already be defined as root and swap, 2 is not available since it's the whole disk) - all space not allocated to other file systems is created as /export/home in partition 7.

Ideally you want to create about 500Mb for /var and 1.5Gb+ for /opt depending on how much 3rd party S/W you intnd installing, you might also increase root to about 2Gb.

To relayout after the build (disk layed out as per your first example) assuming /export/home is empty.
Boot into single user mode from CD - ok> boot cdrom -s
1] mount root 'Mount -Fufs /dev/dsk/c0t0d0s0 /mnt'
2] reformat the disk using 'format' stealing space from partition 7 - don't touch partitions 0,1,2.
3] Call mkfs on the new partitions and resized slice 7
4] mount each new slice in turn as /mnt/a
5] cd to the directory you want to relocate (/mnt/opt)
6] copy the files 'find . -print | cpio -pvdum /mnt/a'
7] umount /mnt/a
8] rm -rf . in the current directory (/mnt/opt) - eek!
9] Repeat steps 4-9 for /var and so on.
10] edit /mnt/vfstab for /opt, /var, /export/home
11] reboot

If you want to be non-destructive you can omit step 8 and test it all works - original directories will be hidden under new mount points. Once tested, bring it up on the boot CD, mount root on /mnt and purge /mnt/opt, /mnt/var to free up root disk space - delete the contents but not the actual directories or else you will have no mountpoint.

All rather hairy and probably easier to reinstall and set up partitions from there.

Julian


 
I have run into the same problem. The factory installs are completely ignorant. I haven't had the time to re-build my machines yet, so I simply moved the /opt directory into my /export/spare directory. I then created a symbolic link to it and things work simply fine.
 
i can't recall if i ever admin'ed solaris, but a standard *nix
hack is to create a directory (e.g. /export/usr) on the capacious disk, move (or to be very safe-copy) the stuff under /usr and them ln -s /export/usr /usr
 
Just a word of caution on the ln -s route to save space. When you come to upgrade or re-install software, if the disk that you have linked to is not mounted when you do the upgrade you can start getting in a mess. It is wise to get things right and 'normal' looking when performing O/S related operations.

Just my two-pence worth.

-Eb

...So You're the Easter Bunny!
 
it is of course in /etc/fstab - if /usr is not mounted, you will have problems well before upgrading
 
Thanks guys, I managed to reinstall the system in custom mode and partitioned the harddisk according to my needs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top