How to resize root partition removing default /home

Issues related to applications and software problems and general support
satimis
Posts: 151
Joined: 2006/11/14 14:24:08

How to resize root partition removing default /home

Post by satimis » 2021/04/12 14:38:35

CentOS 8

How to resize root partition removing default /home? This is a freshly installed CentOS 8. There is no user account on /home.

df -h

Code: Select all

Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             3.8G     0  3.8G   0% /dev
tmpfs                3.8G   26M  3.8G   1% /dev/shm
tmpfs                3.8G  9.6M  3.8G   1% /run
tmpfs                3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/mapper/cs-root   70G  4.9G   66G   7% /
/dev/sdc2           1014M  242M  773M  24% /boot
/dev/mapper/cs-home   40G  618M   40G   2% /home
/dev/sdc1            599M  7.3M  592M   2% /boot/efi
tmpfs                767M  5.8M  762M   1% /run/user/1000
I found following document on Internet.
Resize root partition (or how to remove the default /home partition) on CentOS 7 online
https://gist.github.com/troyfontaine/87 ... d3d12bc377

Whether it is also applicable to CentOS 8. I need root taking up the entire HD.

Please advise. Thanks

Furthermore can I install CentOS for /root only without /home during installation ?

Regards

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to resize root partition removing default /home

Post by TrevorH » 2021/04/12 15:23:16

That does not look like the partitioning done by default. Is this a VMWare VM by any chance?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Re: How to resize root partition removing default /home

Post by satimis » 2021/04/12 15:57:31

No. It is the same 120G SSD drive mentioned on my previous posting;

Which image shall I download
viewtopic.php?f=54&t=77374&hilit=satimis&start=20

I only connect another 120G SSD drive, say SSD2, to this PC and a 1.8TB WD hard drive as well. 1.8TB WD hard drive is storing old data files. The 120G SSD2 is to be used as /home of SSD1 which shall run CentOS 8 only.

Regards

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to resize root partition removing default /home

Post by jlehtone » 2021/04/12 16:11:49

satimis wrote:
2021/04/12 14:38:35
Furthermore can I install CentOS for /root only without /home during installation ?
Yes. You are not forced to create a separate filesystem for content of /home with the installer. Either you choose the manual partitioning option within interactive installer, or you define storage setup in kickstart-file.

satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Re: How to resize root partition removing default /home

Post by satimis » 2021/04/12 16:23:36

Hi jlehtone,

I just connected SSD2 there in case. I wouldn't use it as /home of SSD1. The entire SSD1 will be used for running cPanel only. My immediate need is to delete /home of SSD1. I'm not sure whether the document on my original posting will work on CentOS 8?

Regards

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to resize root partition removing default /home

Post by jlehtone » 2021/04/12 17:12:42

If you don't have anything important (non-reproducible) in your system yet, then install from scratch could be a valid option.
In fact, why not do it both ways? First follow that document and then reinstall. That way you get to experience both options.

satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Re: How to resize root partition removing default /home

Post by satimis » 2021/04/12 20:12:33

I have nothing important on SSD1 ever-since I installed CentOS 8 on it as mentioned on my another posting;
Which image shall I download
viewtopic.php?f=54&t=77374&hilit=satimis&start=20

Also I can remove SSD2 from PC as well as the 1.8TB WD hard drive. What I need is cs-root taking up the whole SSD1 without cs-home.

Please advise how can I do it on re-installation? Thanks

Also it is a good suggestion. I'll follow that document learning its way first before reinstall CentOS 8

Regards


satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Re: How to resize root partition removing default /home

Post by satimis » 2021/04/13 08:05:44

Before reading your posting I have performed the test according to the document on my first posting as follows;

# mkdir /temp
# cp -a /home /temp/
# umount -fl /home
# df -h

Code: Select all

Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             3.8G     0  3.8G   0% /dev
tmpfs                3.8G  101M  3.7G   3% /dev/shm
tmpfs                3.8G  9.6M  3.8G   1% /run
tmpfs                3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/mapper/cs-root   70G  5.3G   65G   8% /
/dev/sdd2           1014M  242M  773M  24% /boot
/dev/sdd1            599M  7.3M  592M   2% /boot/efi
tmpfs                767M  4.6M  763M   1% /run/user/1000
# lvs

Code: Select all

  LV   VG Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home cs -wi-ao---- <39.85g                                                    
  root cs -wi-ao----  70.00g                                                    
  swap cs -wi-ao----   7.80g     
# lvremove /dev/cs/home

Code: Select all

  Logical volume cs/home contains a filesystem in use.
  
I was stuck here. Having searched a while on Internet I was unable finding a solution. There are only 2 applications running Firefox, browser and Terminal

Any advice? Thanks

Regards

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to resize root partition removing default /home

Post by TrevorH » 2021/04/13 08:07:26

Remove it from /etc/fstab and then run systemctl daemon-reload and then re-attempt the same steps.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply