LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 12-19-2010, 06:35 AM   #1
born2bdesi
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Rep: Reputation: 0
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
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
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
Critically waiting for your inputs.

Appreciate it!!

Last edited by born2bdesi; 12-19-2010 at 08:26 AM.
 
Old 12-19-2010, 07:31 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
What is the output of df ?
Please use the code tags when posting terminal output.
 
Old 12-19-2010, 07:41 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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
/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
What is the output of
Code:
df -hT
grep swap /etc/fstab
 
Old 12-19-2010, 08:10 AM   #4
born2bdesi
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for the replies!

Apologies, will use Code Tags from now on..

Here is the output.

Code:
[root@localhost ~]# df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda2     ext3    3.8G  3.3G  372M  90% /
/dev/sda5     ext3     14G 1016M   12G   8% /home
/dev/sda1     ext3     46M   11M   33M  25% /boot
tmpfs        tmpfs    506M     0  506M   0% /dev/shm
.host:/     vmhgfs     56G   43G   14G  77% /mnt/hgfs
Code:
[root@localhost ~]# grep swap /etc/fstab
LABEL=SWAP-sda3         swap                    swap    defaults        0 0
Please reply.
 
Old 12-19-2010, 08:25 AM   #5
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
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.

Last edited by smoker; 12-19-2010 at 08:27 AM.
 
Old 12-19-2010, 08:28 AM   #6
born2bdesi
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Original Poster
Rep: Reputation: 0
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
Please reply.
 
Old 12-19-2010, 08:36 AM   #7
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
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 / ?
 
Old 12-19-2010, 08:42 AM   #8
born2bdesi
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Original Poster
Rep: Reputation: 0
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!!
 
Old 12-19-2010, 08:53 AM   #9
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
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.
 
Old 12-19-2010, 09:03 AM   #10
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
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
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 !
 
1 members found this post helpful.
Old 12-19-2010, 09:05 AM   #11
born2bdesi
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Original Poster
Rep: Reputation: 0
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?
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? 
Code:
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.

Appreciate it!!
 
Old 12-19-2010, 09:20 AM   #12
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
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:
/dev/sda2 /home ext3 defaults 1 2

My boot drive is hda and sda1 is my swap.
 
Old 12-19-2010, 09:45 AM   #13
born2bdesi
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Original Poster
Rep: Reputation: 0
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
Please assist.
 
Old 12-19-2010, 09:52 AM   #14
born2bdesi
LQ Newbie
 
Registered: Dec 2010
Posts: 10

Original Poster
Rep: Reputation: 0
I got a different warning this time when I tried to install Oracle 10g.

Code:
Software installed successfully.
Some warnings were given.

----WARNING---
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.
Any clues!
 
Old 12-19-2010, 09:59 AM   #15
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Clonezilla - Copy /dev/sda2 on computer 1 => /dev/sda4 on computer 2 pizzipie Linux - Software 13 08-04-2014 08:35 PM
ALERT! /dev/sda5 does not exist! mrlinus Linux - Software 3 04-13-2009 12:34 AM
how to remove disk space in /dev/sda8 to increase the /dev/sda7 centguy Linux - Software 16 11-27-2008 06:05 PM
device dev/sda5 ignoring secure Linux - Hardware 2 08-23-2007 02:39 AM
installing slackware to usb harddrive...no /dev/sda2 on disk to mount for cfdisk surfbass Slackware 7 05-09-2006 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration