Readjust disk space between /dev/sda2 and /dev/sda5
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
The partition information, here presented in CODE tags so it is easier to read, is not enough to answer the question without also knowing which partitions are used for what and whether the swap space is used.
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6 48163+ 83 Linux
/dev/sda2 7 515 4088542+ 83 Linux
/dev/sda3 516 776 2096482+ 82 Linux swap / Solaris
/dev/sda4 777 2610 14731605 5 Extended
/dev/sda5 777 2610 14731573+ 83 Linux
Please clarify whether the Oracle Express Edition Database 10g is installed or fails to install.
If it is already installed then you need to find out which directory it expects to store the files that need this space. You could then either create a mount point to free space created by shrinking your home partition, or symlink the required directory to a directory on your existing home partition.
If it's not installing because of lack of free space, then you will have to shrink the home partition and create a new partition that you can mount in the required / directory.
Please note that XE 10G will create up to 4 GB of user files.
Your df output shows 372MB available on the / partition. Maybe you could clear up any files in /tmp but you are looking at a fair amount of work if you decide to increase the partition size. The installed size of XE 10G is only supposed to be 150MB so I can't see why it would fail. Where did you download the rpm install package to ? Somewhere in home or direct to somewhere in / ?
You cannot directly move space from sda2 to sda5. You can only move space from one away(sda2 from sda3, sda3 from sda4, and sda4 from sda5), which is a major PITA. There are a couple of ways to get around this. You can add another drive, copy all the files from the sub directory you need more space in, and then mount the new drive to the sub directory in place. Once you are certain everything is working fine you can unmount the other drive, and THEN delete the contents of the orginal sub directory(to regain the space on the master drive). This is how I handle my /home directory. You could do something similar using another partition on the same drive.
Swapping space is not an easy process. Mounting free space is easier, depending on what is already in the required directory.
It would be easier to reinstall and specify a larger / partition during the install.
Failing that, you will have to use the install disk to boot from and use a partitioning tool such as parted to shrink your home partition, create a new partition in the empty space, then create a filesystem on that partition such as ext3 or what ever you choose. You could then edit your fstab file to point /opt/software at the new partition.
To actually move space to the / partition would entail shrinking home, then moving that partition to the end of the free space, then moving every other partition down until the free space was just after the / partition. You could then extend the / partition.
Initially I would try symlinking /opt/software to a directory on your home partition.
You must create the <directory> first.
In a terminal as root ...
ln -s /home/<user>/<directory> software
Replace <user> and <directory> with real ones on your system.
Last edited by smoker; 12-19-2010 at 09:05 AM.
Reason: forgot the link name !
Can you please take some time and walk me through the process (with commands), I am a newbie to Linux
This is what i understand. Please validate.
1. Add a new drive (e.g. /dev/sda6). How can I create this?
2. Copy all files from /opt/* to the newly created drive. I can do this step :)
3. Mount the new drive to the sub directory in place. Does this command work?
mount /dev/sda6 /opt
In my scenario, I want more space on root (/) partition. At the same time, I do not want to waste the space already available on my home partition; I am running on a 60GB HDD.
On the same drive you would shrink sda5, create a sda6 partition, and then format it.
I do not believe that you can handle the root(/) this way. No pun intended, but it is the root of everything. When I moved my /home directory(in 07?) all I did was to (in gui): format new drive,(temporarily mounted it in media) copy files over(just drug them over), and then (as root in cli) I mounted in (similar as you did above) /home. After I used it for a week and made sure everything was happy, I umounted it, deleted all the data from the orginal /home, and thus regained all the space used by /home(orignal) for root(/). Here is my fstab line I used to make it permament(on bootup). Remember mount points do not take up any(significant) space on the drive.
Responding to Smoker..
I have established a symbolic link and am able to install software successfully by pointing the install location to /opt/software. However, I still cannot install Oracle 10g XE due to the error it has been returning. Can I instruct Oracle to use /opt directory instead?
installing package oracle-xe-univ-10.2.0.1-1.0.i386 needs 82MB on the / filesystem
I got a different warning this time when I tried to install Oracle 10g.
Software installed successfully.
Some warnings were given.
You have insufficient diskspace in the destination directory (/usr/lib) to
install Oracle Database 10g Express Edition. The installation requires at
least 1.5 GB free on this disk.