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 08-08-2010, 01:15 PM   #1
vinnie_vinodh
Member
 
Registered: Dec 2008
Location: India
Distribution: Fedora 10
Posts: 100

Rep: Reputation: 15
Post can i resize root partition & add space to home?


Hello

Well my root (/) partition has 11G free space and my /home is only left with 5g around and /usr has around 8g in my fedora 13 .So is there any possibility to "resize" the root partition and add it to home partition bcoz i see the opposite in the threads(resize home to add space to root).My home has nothin more than a movie which is 700MB and i've installed some new application yesterday. But it shows half of the space is almost used!!!
/dev/sda7 12G 925M 11G 9% /
tmpfs 497M 2.6M 495M 1% /dev/shm
/dev/sda9 12G 5.0G 6.0G 46% /home
/dev/sda8 12G 4.1G 7.3G 36% /usr

Thanks in Advance

Last edited by vinnie_vinodh; 08-08-2010 at 01:17 PM.
 
Old 08-08-2010, 02:14 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
It can be done, but there is risk to your installation. Caution in how you approach the task is called for.

1) DO NOT try to resize mounted partitions. The partitions must be unmounted. You will need a liveCD. SystemRescue or one of the other small distros which are intended for disk rescue and forensics would do fine. Any other liveCD or liveDVD with gparted would also work.

2) Using gparted, resize /dev/sda7 (the root partition) to decrease the size, and increase /dev/sda8 (/usr) to take up the free space. Run that task to completion and save the new partition table.

3) Once more using gparted, resize /dev/sda8 (/usr) to make room at the backend of /dev/sda8 (/usr), then resize /dev/sda9 (/home) to take up the free space. Save the new partition table and exit gparted.

4) Boot Fedora. You should now have a larger /home partition.

I have advised step-wise resizing because three partitions are involved, and you are trying to take room from the front partition and add it to the back partition of the three. My experience with trying to do all the resizing in one step had disastrous results. So now, I do it step-wise as described above.

Good luck!
 
1 members found this post helpful.
Old 08-08-2010, 02:20 PM   #3
vigilandy
Member
 
Registered: Mar 2010
Location: Tokyo
Distribution: Arch, Fedora
Posts: 71

Rep: Reputation: 23
One thing to add is back up everything before your start. That way even if you hose your system, you still have your data.
 
1 members found this post helpful.
Old 08-08-2010, 02:23 PM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
Thank you vigilandy. I was just about to edit my post when I saw your addition.
 
Old 08-08-2010, 02:39 PM   #5
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Stable
Posts: 185

Rep: Reputation: 23
Assuming you are running ext2/ext3/ext4 filesystems and assuming that your partitions in question are physically next to each other
(and you can only do this if you can shrink the TAIL of one partition/filesystem and grow the HEAD of the next partition/filesystem)
you need to CAREFULLY shrink the leading filesystem (via resize2fs) smaller
this will shrink the filesystem to the FRONT (beginning) of the partition
then use parted/sfdisk/cfdisk to shrink the partition to the same size (or slightly larger) than the filesystem.
If you shrink the partition to be smaller than the filesystem, you will cry.
Then use parted/sfdisk/cfdisk to grow the HEAD of the trailing partition
and use resize2fs to grow that filesystem to fit the partition.

=====

OK, this is probably not the best advice, but it is what I have done and it works for me:

I faced a similar problem about three or four years ago, and was considering totally re-partitioning my hard drives, using my backup drive as a holding area so I wouldn't have to do a reinstall (I've been running this install since Woody, on three different computers). I sat down and tried to plan how to repartition the drive to meet any possible drive usage that I could imagine.

I gave up. I could not find a "perfect" partitioning scheme that I could always think of a set of circumstances to require me to have to repartition again. So I started using LVM (Logical Volume Management), using my backup drive as a temporary holding area while I copied and moved and juggled filesystems around. I currently have 24 logical volumes spanning two volume groups across 4 hard drives (about 2 terabytes). I can now, at will, shrink/grow filesystems/partitions (I think it's only ext{2|3|4} filesystems that allow this) and it is extremely flexible.

(((NOTE: It seems to me that LVM is one of those tools that you shouldn't even worry about until you can articulate a need for it.)))

=====

The worst solution, and it is very sloppy and you shouldn't tell anyone if you do this because it is such a kludge, is to make liberal use of symbolic links to make a "hide" directories linking from one filesystem to another. Do not do this, it is too sloppy and confusing, but it is a quick and dirty kludge.
 
1 members found this post helpful.
Old 08-09-2010, 06:25 AM   #6
vinnie_vinodh
Member
 
Registered: Dec 2008
Location: India
Distribution: Fedora 10
Posts: 100

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bigrigdriver View Post
It can be done, but there is risk to your installation. Caution in how you approach the task is called for.

1) DO NOT try to resize mounted partitions. The partitions must be unmounted. You will need a liveCD. SystemRescue or one of the other small distros which are intended for disk rescue and forensics would do fine. Any other liveCD or liveDVD with gparted would also work.

2) Using gparted, resize /dev/sda7 (the root partition) to decrease the size, and increase /dev/sda8 (/usr) to take up the free space. Run that task to completion and save the new partition table.

3) Once more using gparted, resize /dev/sda8 (/usr) to make room at the backend of /dev/sda8 (/usr), then resize /dev/sda9 (/home) to take up the free space. Save the new partition table and exit gparted.

4) Boot Fedora. You should now have a larger /home partition.

I have advised step-wise resizing because three partitions are involved, and you are trying to take room from the front partition and add it to the back partition of the three. My experience with trying to do all the resizing in one step had disastrous results. So now, I do it step-wise as described above.

Good luck!
Thank You RigDriver
I'll do it with system Rescue CD. One more thing is my /home partition is 12G and 6G is used almost in it, what could cud have possibly taken?Do you think the applications that we install will take that much?..I had this problem previously in f10 but ignored it and never had one like this with other distros I used.
 
Old 08-09-2010, 06:35 AM   #7
vinnie_vinodh
Member
 
Registered: Dec 2008
Location: India
Distribution: Fedora 10
Posts: 100

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kevinbenko View Post
Assuming you are running ext2/ext3/ext4 filesystems and assuming that your partitions in question are physically next to each other
(and you can only do this if you can shrink the TAIL of one partition/filesystem and grow the HEAD of the next partition/filesystem)
you need to CAREFULLY shrink the leading filesystem (via resize2fs) smaller
this will shrink the filesystem to the FRONT (beginning) of the partition
then use parted/sfdisk/cfdisk to shrink the partition to the same size (or slightly larger) than the filesystem.
If you shrink the partition to be smaller than the filesystem, you will cry.
Then use parted/sfdisk/cfdisk to grow the HEAD of the trailing partition
and use resize2fs to grow that filesystem to fit the partition.

=====

OK, this is probably not the best advice, but it is what I have done and it works for me:

I faced a similar problem about three or four years ago, and was considering totally re-partitioning my hard drives, using my backup drive as a holding area so I wouldn't have to do a reinstall (I've been running this install since Woody, on three different computers). I sat down and tried to plan how to repartition the drive to meet any possible drive usage that I could imagine.

I gave up. I could not find a "perfect" partitioning scheme that I could always think of a set of circumstances to require me to have to repartition again. So I started using LVM (Logical Volume Management), using my backup drive as a temporary holding area while I copied and moved and juggled filesystems around. I currently have 24 logical volumes spanning two volume groups across 4 hard drives (about 2 terabytes). I can now, at will, shrink/grow filesystems/partitions (I think it's only ext{2|3|4} filesystems that allow this) and it is extremely flexible.

(((NOTE: It seems to me that LVM is one of those tools that you shouldn't even worry about until you can articulate a need for it.)))

=====

The worst solution, and it is very sloppy and you shouldn't tell anyone if you do this because it is such a kludge, is to make liberal use of symbolic links to make a "hide" directories linking from one filesystem to another. Do not do this, it is too sloppy and confusing, but it is a quick and dirty kludge.
Thank You KevinBenco
LVM I've never used it ..
Every time I do an Linux installation it is partition based .So with LVM and with ext4/3/2 FS one can shrink ,grow the filesystem ? If it is so then next time i'll go for LVM ,but before that i need to check the beginner guide to LVM.
 
  


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
How to resize linux root partition? And use the remaining space... tab80 Fedora 3 01-08-2008 04:57 AM
2006 root partition full. How resize during installation and keep /home intact? Bengan Mandriva 11 01-07-2006 12:29 PM
not enough space on /home. resize partitions? bschiett Linux - Newbie 6 12-18-2005 03:40 PM
moving /home /root & /var to new partition CrashedAgain Linux - General 8 11-24-2005 11:44 AM
How much space for root & home? oomfoofoo Linux - Laptop and Netbook 5 08-12-2005 04:22 PM


All times are GMT -5. The time now is 07:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration