Readjust disk space between /dev/sda2 and /dev/sda5
[CODE]Hi All-
I am new to Linux and I have it installed on VMWare Fusion. All was happy until the Linux installation was succeeded and I am able to log in as root and created a user for myself. However, when I installed Oracle Express Edition Database 10g, it complains that I have insufficient disk space on '/' directory. Here is a snapshot of my system. Wondering if I would like to swap the free space from /dev/sda5 into /dev/sda2. Code:
[root@localhost ~]# fdisk -l Appreciate it!! |
What is the output of df ?
Please use the code tags when posting terminal output. |
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.
Code:
Device Boot Start End Blocks Id System Code:
df -hT |
Thanks for the replies!
Apologies, will use Code Tags from now on.. :) Here is the output. Code:
[root@localhost ~]# df -hT Code:
[root@localhost ~]# grep swap /etc/fstab |
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. |
Thanks for your reply smoker!
Oracle Installation failed with the following error. Code:
installing package oracle-xe-univ-10.2.0.1-1.0.i386 needs 82MB on the / filesystem |
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 / ?
|
I have downloaded the RPM package into /home/<my login> and running the installation under 'root' login.
However, I would like to get your inputs on these. Apart from Oracle10g installatiion, I would also like to install other software under /opt/software director which also has very low space at the moment. Can I swap some space from /dev/sda5 to /dev/sda2; If so, please provide with instructions / steps to go ahead. Appreciate your help!! |
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 ... Code:
cd /opt |
Thanks for your reply, Lazlow!
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. Code:
1. Add a new drive (e.g. /dev/sda6). How can I create this? Appreciate it!! |
By new drive I meant a physical drive.
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. Quote:
My boot drive is hda and sda1 is my swap. |
Thanks for your replies, Smoker & Lazlow!
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? Code:
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.
Code:
Software installed successfully. |
What about commenting swap out of fstab, deleting the swap partition sda3 and growing sda2 into the space formerly taken by sda3? sda5 could be shrunk to make space for a new swap partition.
|
Thanks Catkin.
I would appreciate if you could throw some light on the commands to be run in order to increase the space in sda2. |
Quote:
|
Quote:
|
Sure, I would wait for your inputs.
I am going to be online again in a couple of hours. Looking forward for your support! |
|
Quote:
The swap partition can be commented out of /etc/fstab by a leading # and then edited to suit and uncommented when the partition name of the new swap is known. |
Thanks for all your replies!
Here is what has been done. Code:
Pre: Commented SWAP Partition from /etc/fstab (As suggested by catkin) Current configuration Code:
Disk /dev/sda: 42.9 GB, 42949672960 bytes Code:
Unable to access resume device (LABEL=SWAP-sda3) Code:
Partition 2 does not end on cylinder boundary. Highly appreciate your inputs! |
"Unable to access resume device" probably comes from GRUB and could be fixed by editing /boot/grub/menu.lst.
"Partition 2 does not end on cylinder boundary" is a warning, not an error. To adjust the partition table to suit fdisk you could boot gparted again and set it to use "Align to cylinder" instead of "Align to MiB" and then resize /dev/sda2. In retrospect that would have been a better choice the first time around (Sorry -- I do not use gparted and have only just learned of this setting by netsearching). |
Unable to resume device is because you have not edited fstab to reflect that the swap partition is now on sda6. Change sda3 to sda6 in fstab and it should be fine.
|
All times are GMT -5. The time now is 02:54 AM. |