LinuxQuestions.org
Visit Jeremy's Blog.
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 02-12-2015, 01:45 AM   #1
omniok
LQ Newbie
 
Registered: May 2014
Posts: 15

Rep: Reputation: Disabled
Allot free space from one partition to other


I have a RHEL 5.3 machine with the following partitions and free space:

Free space on the partitions
/ : 74GB
/boot : 81MB
/var : 73GB
/home : 37GB
/icat : 758MB
/opt : 1.5GB

Now is it possible to allot a free space of some other partitions to /opt? I want around 100 GB more space on /opt. Thus, if it is possible I could move 50GB from /var and /20 GB from /home to /opt. This can make at least 70 GB space available.
What are other possible ways to increase space on /opt?
Thanks in advance !!!
 
Old 02-12-2015, 01:50 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
What you have shown is filesystem directories.

You should output the partitions info by using fdisk -l /dev/sdx.

Also specify which type of partition system is it. MSDOS or GPT.

Giving more info would help.

For other ways you can add a new hard disk drive and move /opt there.
 
Old 02-12-2015, 02:05 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,797

Rep: Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888
yes, giving more info will help us to give better tips...
but in the meantime here is a link to check: http://gparted-forum.surf4.info/viewtopic.php?id=600
 
Old 02-12-2015, 02:08 AM   #4
omniok
LQ Newbie
 
Registered: May 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thanks veerain for you comments. However, the exact command "fdisk -l /dev/sdx" did not give any output, hence attaching the output of "fdisk -l". Also the partition table is msdos.

Quote:
Originally Posted by veerain View Post
What you have shown is filesystem directories.

You should output the partitions info by using fdisk -l /dev/sdx.

Also specify which type of partition system is it. MSDOS or GPT.

Giving more info would help.

For other ways you can add a new hard disk drive and move /opt there.
Attached Files
File Type: txt fdisk_output.txt (1.8 KB, 14 views)

Last edited by omniok; 02-12-2015 at 02:10 AM.
 
Old 02-12-2015, 03:25 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,797

Rep: Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888
in general you should replace x, but fdisk -l was ok.
fdisk -l /dev/sda
fdisk -l /dev/sdb
fdisk -l /dev/sdc
also please post the output of the command: mount
 
Old 02-12-2015, 04:28 AM   #6
omniok
LQ Newbie
 
Registered: May 2014
Posts: 15

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
in general you should replace x, but fdisk -l was ok.
fdisk -l /dev/sda
fdisk -l /dev/sdb
fdisk -l /dev/sdc
also please post the output of the command: mount
Do these partitions need to be LVM enabled?

The output for mount is:

/dev/sdd2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda6 on /home type ext3 (rw)
/dev/sda5 on /icat type ext3 (rw)
/dev/sdc2 on /var type ext3 (rw)
/dev/sdb2 on /opt type ext3 (rw)
/dev/sda2 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
 
Old 02-12-2015, 05:30 AM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,797

Rep: Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888
so now we can see /opt is located on /dev/sdb.
sdb has two partitions, sd2 is used for /opt. The size of the partition itself is almost 140 GB, but you use only 1.5 GB of it (that is the size of the filesystem).
You can also try:
cfdisk -P s /dev/sdb
parted -l /dev/sdb
df -h /dev/sdb2
just to be sure.
If it was really sure you can use resize2fs to increase the size of that filesystem because you have already space (which was not in use until now).

But beware, I cannot guarantee anything, you need to backup every important data before modifying your OS. You can only resize your filesystem if you boot another os (from usb, live disk).
 
Old 02-12-2015, 07:56 AM   #8
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by pan64 View Post
so now we can see /opt is located on /dev/sdb.
sdb has two partitions, sd2 is used for /opt. The size of the partition itself is almost 140 GB, but you use only 1.5 GB of it (that is the size of the filesystem).

If it was really sure you can use resize2fs to increase the size of that filesystem because you have already space (which was not in use until now).

But beware, I cannot guarantee anything, you need to backup every important data before modifying your OS. You can only resize your filesystem if you boot another os (from usb, live disk).
The size of /dev/sdb2 is only 100GB. And thread starter has said only 15GB is free in /opt.
 
Old 02-12-2015, 08:12 AM   #9
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,797

Rep: Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888
so I misunderstood something, but anyway it looks like there is free space on that drive. If that was not enough he need to use lvm or another disk or move something away from /opt onto another partition (which can be mounted under /opt)
 
Old 02-12-2015, 08:20 AM   #10
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Stats:

/var @ /dev/sdc2; Free space: 73GB; Total space 80GB
/dev/sdc total size 146.8GB partitions sdc1, sdc2 and sdc3
/dev/sdc3 Total size: 4GB Linux swap
You resize fs in sdc2 to 20GB. Delete sdc3 swap partition. Adjust partition size of sdc2 to 20GB. Recreate sdc3 with type swap of 4GB. Create sdc4 with rest of space (60GB) for /opt

/home @ /dev/sda6: Free space: 37 GB: Total space: 40GB
You resize fs in sda6 to 10GB. Adjust partition size of sda6 to 10GB. Create new extended partition with rest of space (30GB) /dev/sda7

So total accumulated space 30+60 = 90GB.

Free partitions /dev/sda7 (30GB), /dev/sdc4 (60GB).
And your /opt @ /dev/sdb2; Total space 100GB; free space 15GB.

Now the problem is /opt is using actively about 85GB. An you have to extend it with free space from above partitions.

One of our unifying option is LVM but would have to backup /opt first.

If you can't do that; then we are left with dmsetup (device mapper).

You using dmsetup program can create a block device unifying /dev/sdb2, /dev/sda7 and /dev/sdc4.
We use linear target of dmsetup to create a new block device combining all provided block devices.

Read dmsetup man page for that.

After combining use resize2fs to use whole space.

And you have to make a way of creating device mapper block device and mounting it as /opt at boot time before anything uses that.

Any help if needed please post.

Be CAREFUL or else you may loss your data.

Last edited by veerain; 02-12-2015 at 08:23 AM.
 
  


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
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 01:57 PM
What is the maximum size of swap partition I can allot? tapti Linux - General 10 08-18-2009 01:19 PM
Allot space to a new user ArulPrabhuT Programming 3 08-14-2004 09:52 AM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 11:19 PM

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

All times are GMT -5. The time now is 10:05 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration