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

Re: How to resize root partition removing default /home

Post by satimis » 2021/04/13 08:26:47

# cat /etc/fstab

Code: Select all

/dev/mapper/cs-root     /                       xfs     defaults        0 0
UUID=4dd9c290-b10e-4453-9ca2-b7466e176c4e /boot                   xfs     defaults        0 0
UUID=47D3-5CE5          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
/dev/mapper/cs-home     /home                   xfs     defaults        0 0
/dev/mapper/cs-swap     none                    swap    defaults        0 0
Whether comment out the line;

Code: Select all

/dev/mapper/cs-home     /home                   xfs     defaults        0 0
Then run
# systemctl daemon-reload

and continue next steps;

Step 4 - Remove the home LVM volume
# lvremove /dev/cs/home

Step 5 - Resize the root LVM volume
# lvextend -L+39G /dev/cl/root

and so on

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 09:57:59

Well if you aim to remove the cs-home LV then you definitely need to remove it from /etc/fstab since the system will enter emergency mode at the next boot if the entry is still there and the LV is not.
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/13 15:21:58

Tried again.

Start CentOS

# mkdir /temp
/temp already exit

# nano /etc/fstab
and comment out following line

Code: Select all

/dev/mapper/cs-home     /home                   xfs     defaults
# systemctl daemon-reload

# umount -fl /home

# lvremove /dev/cs/home

Code: Select all

Logical volume cs/home contains a filesystem in use.
Still the same.

Reboot CentOS. This time I couldn't login. I'm now posting on another PC. It is very funny to me

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/13 20:10:16

How did you login before?

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

Re: How to resize root partition removing default /home

Post by satimis » 2021/04/14 01:36:46

It was the same.

After CentOS 8 started a login page popup. User name already there, I only fill in password and then click sign-in. That is all. Now no password can work including root password.

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/14 06:39:29

When you login, you have a "session". You access files in the home directory of your account. GUI session has many processes that access files. If you did the previous commands from session of regular account, then the /home was in use.

The errors told that too: "contains a filesystem in use". The "umount" cannot disconnect the filesystem in /home, because something still does access files there. You did try to saw the branch that you were sitting on.

Code: Select all

  LV   VG Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home cs -wi-ao---- <39.85g
That shows attributes of the LV: -wi-ao----
o -- open. Filesystem within LV is in use. The 'umount' failed to unmount.
a -- active. The LV is in "active" state. That can be toggled with lvchange when LV is not open. See man lvchange
lvremove only LVs that are not open and not active.

You must check/know the state of your system both before and after you give a command.
Before, so you know which commands you need to give. You have shown that you repeat commands that you shouldn't.
After, so you know whether the command did have the desired effect.


Ctrl-Alt-F2 should change view from the GUI login dialog to text-based "virtual console".
There you can type username and password and then you have CLI session. Much less disk access.

However, you don't want to login with your regular account. It does not have home directory.
GUI login as root is disabled by default. You should be able to login as "root" in the console.
Account "root" does not have its home directory within /home. Therefore, it is safer to handle /home as root.

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

Re: How to resize root partition removing default /home

Post by satimis » 2021/04/14 08:04:46

I can't login. Please see attached photos.

After CentOS started login page popup. Pls see photo1 attached

Clicking "Stephen Liu" it popup another login page Pls see photo2 attached

After filling password --> click "Sign In ", it starts the popup page of photo1 again

Clicking "Not listed", filling in username and password. It is the same unable to login
photo2.jpeg
photo2.jpeg (87.24 KiB) Viewed 1211 times
photo1.jpeg
photo1.jpeg (37.22 KiB) Viewed 1211 times
Any suggestion?

Regards

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: How to resize root partition removing default /home

Post by tunk » 2021/04/14 09:50:03

Did you try Ctrl-Alt-F2 as jlehtone suggested?

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

Re: How to resize root partition removing default /home

Post by satimis » 2021/04/14 10:27:03

Yes, starting the text mode

from there login as root and ran;

# startx

starting CentOS 8 GUI mode. But I couldn't start Firefox there to look at the instruction document. Either I have to print the document or put another PC side-by-side.

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/14 11:04:07

satimis wrote:
2021/04/14 10:27:03
from there login as root and ran;

# startx

starting CentOS 8 GUI mode.
Don't do that. Stay in CLI mode.

You could save text from webpage into text file and copy that file into your system (with rsync) for reading (with less).

Post Reply