LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-25-2017, 01:33 PM   #1
Yogi_1
LQ Newbie
 
Registered: Apr 2017
Posts: 4

Rep: Reputation: Disabled
How to increase the size of /home directory


Hi Guys, Need your help, I am new to Linux, I want to increase the size of /home directory. Could you please share the commands / steps by step implementation to resolve this issue.

current details as given below:
-bash-3.2$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 61G 15G 44G 25% /
/dev/sda5 1.5G 1.5G 0 100% /home
/dev/sda2 2.4G 493M 1.8G 22% /tmp
/dev/sda1 1.2G 43M 1.1G 4% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/hdc 2.9G 2.9G 0 100% /media/Enterprise Linux dvd 20100405

Thanks in advance!
 
Old 04-26-2017, 06:51 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
You'd need to use something like gparted by this point since you have a partition after/to the right of the /home partition which just happens to be /. This is where using LVM would have been good, since it is good for this type of thing.
 
1 members found this post helpful.
Old 04-26-2017, 07:00 AM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
The first thing that you need to do is to decide what you want the new sizes of your various partitions to be. 1.5GB for /home was always going to be tight.

Then, you need to back up any data that you have.

After that, you need to boot off a media containing a partition manager, e.g. Gparted Live, change the partition sizes as required, and reboot. If there are any problems with the boot, you'll probably have to boot up with a live media and do some configuring of the system to get it to work.

That's a general overview anyway. For future reference, when deciding on your partitions for a Linux installation, give yourself room to grow as it's usually easier to do that than to repartition afterwards (although, as r3sistance mentioned, LVM makes life easier).
 
1 members found this post helpful.
Old 04-26-2017, 07:05 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,705

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
We can't be sure of the layout until we see the output from this - run it in a terminal as root or use sudo
Code:
parted /dev/sda "print free"
df -hT

Last edited by syg00; 04-26-2017 at 07:05 AM. Reason: added df
 
1 members found this post helpful.
Old 04-26-2017, 07:09 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,316
Blog Entries: 13

Rep: Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372
Hi Yogi_1 and welcome to LQ.

r3sistance's suggestion of gparted is a good one, and as they say, a virtual machine, or a live boot media is the way to go. You will not be able to increase the size of a partition which is mounted, or one which you are using at the time as part of being booted into Linux. Therefore you should boot using a live USB or DVD and run gparted from that so as to be able to access and change your home.

Seems that you might be running a commercial distribution of Linux? Due to the "Enterprise Linux dvd 20100405" shown in your df output. Perhaps you should indicate what distribution you are running to help others to best give you some advice here.

Note also that you will need to run gparted using sudo or as superuser. You should update to indicate whether you know how to do any of this.

Please also understand that while you've posted your df output and described what you want to do, it's poor behavior to just post a question asking for exact commands to accomplish something. Please do some research and also recognize that LQ members a volunteer members of a community where the intentions are to help others to learn about Linux. Therefore someone posting an exact command flow (1) may be giving you something incorrect because they do not have all the information, (2) doesn't help you learn yourself how to accomplish this, except by way of copy/paste.
 
Old 04-29-2017, 08:32 AM   #6
Yogi_1
LQ Newbie
 
Registered: Apr 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you all for your help! As suggested i have downloaded the gparted software "gparted-live-0.28.1-1-i686". Could you please help by sharing step by step implementation to extend the size /home dir using gparted software.

Please find given below configuration details:
VMwareŽ Workstation : 9.0.2 build-1031769

LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Release: 5.5
Codename: Carthage
 
Old 04-29-2017, 08:48 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
looks like you got everything squeezed next to each other so tightly you lost two partitions.
Code:
/dev/sda6 61G 15G 44G 25% /
/dev/sda5 1.5G 1.5G 0 100% /home
/dev/sda2 2.4G 493M 1.8G 22% /tmp
/dev/sda1 1.2G 43M 1.1G 4% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/hdc 2.9G 2.9G 0 100% /media/Enterprise Linux dvd 20100405
where is sda3 and sda4? I know df -h gives different output, but one of them has to be a place holder for more logical partitions. not two of them you're only showing 1,2,5,6 - 3 and 4 are missing.

nevertheless, the easiest way is to shrink one of them or both on either side of 5 then give it to 5

has to be unmounted.

if you can login into root account, then all you got a do is unmount /home the other one, and where is sda4 (and sda3)? then shrink sda4 or sda3 then give that new space to sda5 /home
Code:
mount -a
logout of root then into ./home user

If you want to take away from your root / then just apply the same methodology using the booted gParted. Then just reboot to mount all of them again.

----

256 ssd
Code:
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 232.9G  0 disk 
├─sda1        8:1    0   500M  0 part <-win 10
├─sda2        8:2    0  97.2G  0 part /media/win10
├─sda3        8:3    0   450M  0 part <- win 10
├─sda4        8:4    0     1K  0 part <------ place holder for my logical drives. 
├─sda5        8:5    0    21G  0 part <----- other Linux OS
├─sda6        8:6    0  25.5G  0 part / <-- current Linux OS I am in
└─sda7        8:7    0  88.2G  0 part /home <- self explanatory
you are not showing everything, I think I've stressed that enough. Without that information it is hard to advise other than what I have.

Last edited by BW-userx; 04-29-2017 at 09:11 AM.
 
Old 04-29-2017, 09:25 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
@BW-userx. The numbering is usually based on the position of the entries in the MFT. In this case it looks likely that sda3 is in fact the third entry in the MFT, marked as an extended partition, with the fourth entry not currently being used. sda5 and 6 are the first two logical partitions created under sda3.

The lack of sda3 and sda4 is perhaps a red herring here. However GParted, in my experience, does not like resizing partitions "over" an extended partition divide e.g. it wouldn't like reducing sda2 and then giving that space to an extended ext5.

sudo parted -l should cast some more light on the situation.

To summarise, it looks as if sda5 will have to slice some space out of sda6, which given that sda6 is / may require some mucking around.

The OP still hasn't said how much space they want the new /home to have.
 
Old 04-29-2017, 09:54 AM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Quote:
Originally Posted by hydrurga View Post
@BW-userx. The numbering is usually based on the position of the entries in the MFT. In this case it looks likely that sda3 is in fact the third entry in the MFT, marked as an extended partition, with the fourth entry not currently being used. sda5 and 6 are the first two logical partitions created under sda3.

The lack of sda3 and sda4 is perhaps a red herring here. However GParted, in my experience, does not like resizing partitions "over" an extended partition divide e.g. it wouldn't like reducing sda2 and then giving that space to an extended ext5.

sudo parted -l should cast some more light on the situation.

To summarise, it looks as if sda5 will have to slice some space out of sda6, which given that sda6 is / may require some mucking around.

The OP still hasn't said how much space they want the new /home to have.
I was ball parking not knowing what 3 and 4 is.
lets see, three primary the 4th as a place holder for extended.
he has
/dev/sda6 61G 15G 44G 25% /
/dev/sda5 1.5G 1.5G 0 100% /home

Ok I see it now, best take off from / root, because sda4 would be his place holder. personally I do now understand why he has it split up like that and keeping it all on the same drive. Boot separate maybe, but tmp separate on same drive? It us temp whatever is in there can be rid of if it starts taking up too much room being kept on / root. so yeah he'd have to push some data around to get it off root.

he's prob watching the high lights of some game -- got a wait for more from him.
 
Old 04-29-2017, 09:57 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,492

Rep: Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106
Not really. The output of the df command only shows mounted filesystems. I would guess that sda3 and sda4 are swap and the extended partition. The order of the filesystems in the output of the df command does not indicate how they were created.

The only partition to steal space from is the / partition and it would help to see the output of the parted command or fdisk -l (that is a small L) to see how the partitions were created. Normally logical partitions are created in order so sda5 and sda6 should be next to each other so the following should work. Tentative steps are:

shrink sda6 to the size desired
move it to the end of the extended partition
extend sda5 to use the empty space

As suggested you to need run parted from a live CD. As always be sure to have a good backup.

Last edited by michaelk; 04-29-2017 at 09:59 AM.
 
Old 04-29-2017, 10:10 AM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
Quote:
Originally Posted by michaelk View Post
Not really. The output of the df command only shows mounted filesystems. I would guess that sda3 and sda4 are swap and the extended partition. The order of the filesystems in the output of the df command does not indicate how they were created.

The only partition to steal space from is the / partition and it would help to see the output of the parted command or fdisk -l (that is a small L) to see how the partitions were created. Normally logical partitions are created in order so sda5 and sda6 should be next to each other so the following should work. Tentative steps are:

shrink sda6 to the size desired
move it to the end of the extended partition
extend sda5 to use the empty space

As suggested you to need run parted from a live CD. As always be sure to have a good backup.

Ah, good call. It doesn't affect the final operation, but I had forgotten about swap. You never know though, the swap partition might still turn out to be logical partition sda7.
 
Old 04-29-2017, 10:20 AM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,492

Rep: Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106
This is true.

For those that still use legacy MBR, primary partitions can be created in any order. Any primary partition can be labeled as an extended partition and there is no requirement to create all four.
 
1 members found this post helpful.
Old 05-01-2017, 04:27 AM   #13
Yogi_1
LQ Newbie
 
Registered: Apr 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you friends for your quick responses.
Please find given below requested details:

fdisk -l

Disk /dev/sda: 75.1 GB, 75161927680 bytes
255 heads, 63 sectors/track, 9137 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 153 1228941 83 Linux
/dev/sda2 154 472 2562367+ 83 Linux
/dev/sda3 473 727 2048287+ 82 Linux swap / Solaris
/dev/sda4 728 9137 67553325 5 Extended
/dev/sda5 728 918 1534176 83 Linux
/dev/sda6 919 9137 66019086 83 Linux

------------------------------------------------------------------------------
sudo parted -l
Warning: Unable to open /dev/hdc read-write (Read-only file system). /dev/hdc has been opened read-only.
Error: Unable to open /dev/hdc - unrecognised disk label.


Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 75.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 1258MB 1258MB primary ext3 boot
2 1258MB 3882MB 2624MB primary ext3
3 3882MB 5980MB 2097MB primary linux-swap
4 5980MB 75.2GB 69.2GB extended
5 5980MB 7551MB 1571MB logical ext3
6 7551MB 75.2GB 67.6GB logical ext3


Error: Unable to open /dev/md0 - unrecognised disk label.

s
@michaelk: Thank you for sharing implementation steps. I am new to Linux, could you please share the command or if possible any documents to get resolve my requested issue.

shrink sda6 to the size desired---how to do this?
move it to the end of the extended partition---how to do this?
extend sda5 to use the empty space---how to do this?
Please help by sharing steps. Thanks.
 
Old 05-04-2017, 12:28 PM   #14
Yogi_1
LQ Newbie
 
Registered: Apr 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hello, anyone please share the steps.
 
Old 05-04-2017, 12:38 PM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,492

Rep: Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106Reputation: 4106
This should help.
http://www.dedoimedo.com/computers/gparted.html
 
1 members found this post helpful.
  


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
[SOLVED] Need help to increase /home partition size - gparted not working quasar66 Ubuntu 2 01-20-2012 12:28 AM
Increase size of my home folder running openSuse 11.3 pntale Linux - Newbie 12 07-07-2011 02:44 AM
How to increase the home partition size in vmwared ubuntu Detriamus Linux - Newbie 4 08-21-2010 01:33 PM
how to increase /home directory size vin08rag Linux - Newbie 7 03-02-2010 03:19 AM
how to increase the size of home partition srnerkar1 Linux - Software 1 12-05-2005 05:28 AM

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

All times are GMT -5. The time now is 01:34 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
Open Source Consulting | Domain Registration