Move disk space

Good afternoon folks,

I would like some help, if it is possible to move some disk from /work to /.

I don’t want to have to redo the machine, it’s in the OCI and it’s very bureaucratic.

Note: That 3.5G is rather small, but then again you seem to have a 200G disk. Anyway, the 3.5G is clearly less than what default install would do, but then again the default install does not create /work.

Lets say that you do need more space in /var/log that is in rocky-root volume. You can’t shrink the ISCSI_...-work volume, because XFS does not support shrink.

You can create directory /work/var_log.
Then copy everything from current /var/log into /work/var_log.
Next remove everything from /var/log.
Finally mount /work/var_log to /var/log.
Content of /work/var_log will then be seen in /var/log; what is written to /var/log will in reality use space from the ISCSI_...-work volume.

The mount should use bind option. One can add an entry to /etc/fstab:

/work/var_log  /var/log  none  bind  0  0

The example of /var/log is tricky, because the system should not write to source while one does the copy-remove-mount and logs are written and/or syslog does have files open continuously there. Depends on what/where you need “space”.

I’m recreate a clone VM. But i’m create a new block volume ISCSI 50 GB, and i dont know how to mount all resource in my /.

[root@LXCPRD01OARC011 ~]# sudo lvextend -l +100%FREE /dev/mapper/rocky-root
New size (895 extents) matches existing size (895 extents).
[root@LXCPRD01OARC011 ~]#
[root@LXCPRD01OARC011 ~]#
[root@LXCPRD01OARC011 ~]#
[root@LXCPRD01OARC011 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.7G 0 7.7G 0% /dev
tmpfs 7.7G 0 7.7G 0% /dev/shm
tmpfs 7.7G 17M 7.7G 1% /run
tmpfs 7.7G 0 7.7G 0% /sys/fs/cgroup
/dev/mapper/rocky-root 3.5G 3.0G 525M 86% /
/dev/sda2 1014M 223M 792M 22% /boot
/dev/sda1 511M 5.8M 506M 2% /boot/efi
tmpfs 1.6G 0 1.6G 0% /run/user/1000
tmpfs 1.6G 0 1.6G 0% /run/user/0
[root@LXCPRD01OARC011 ~]# lsblk
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 3.5G 0 part
└─rocky-root 253:0 0 3.5G 0 lvm /
[root@LXCPRD01OARC011 ~]#

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.