On 1/24/24 11:27 PM, Greg Wooledge wrote:
On Wed, Jan 24, 2024 at 10:43:51PM +0100, Miroslav Skoric wrote:
I do not have root account.
Sure you do. You might not have a root *password* set.
(I use sudo from my user account.) I think I
already tried rescue mode in the past but was not prompted for root
password.
You can set a root password:
sudo passwd root
That should allow you to enter single-user mode, or to login directly
as root on a text console, both of which are things that you may need
to do as a system administrator. Especially if you're trying to
unmount /home.
Of course, sorry for my mixing terms. In fact I have never logged in
directly as root so I thought the account was disabled or unusable.
In any case, after setting a root password I did this:
1. Log-out as user (in GUI)
2. Ctrl-Alt-F2
3. Log-in as root (in CLI)
4. # lvreduce --size -50G --resizefs /dev/mapper/localhost-home
Do you want to unmount "/home" ? [Y|n] y
...
...
Size of logical volume localhost/home changed from 261.00 GiB (66816
extents) to 211.00 GiB (54016 extents).
Logical volume localhost/home successfully resized.
... after reboot ...
# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.5G 0 1.5G 0% /dev
tmpfs 297M 8.9M 288M 3% /run
/dev/mapper/localhost-root 6.2G 4.7G 1.2G 81% /
/dev/mapper/localhost-usr 15G 11G 2.7G 80% /usr
tmpfs 1.5G 0 1.5G 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.5G 0 1.5G 0% /sys/fs/cgroup
/dev/sda1 228M 142M 74M 66% /boot
/dev/mapper/localhost-home 208G 60G 138G 31% /home
/dev/mapper/localhost-var 3.7G 2.0G 1.6G 57% /var
/dev/mapper/localhost-tmp 2.3G 57K 2.2G 1% /tmp
tmpfs 297M 32K 297M 1% /run/user/1000
# vgdisplay
--- Volume group ---
VG Name localhost
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 21
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 6
Open LV 6
Max PV 0
Cur PV 1
Act PV 1
VG Size <297.85 GiB
PE Size 4.00 MiB
Total PE 76249
Alloc PE / Size 62346 / <243.54 GiB
Free PE / Size 13903 / <54.31 GiB
VG UUID fbCaw1-u3SN-2HCy-w6y8-v0nK-QsFE-FETNZM
... and then I extended /, /usr, and /var for 1GB each. Seems all ok.
Thank you!