Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Then, I presume I would also have to resize the ext4 partition inside volHome. Since it is ext4, I would go with resize2fs:
Code:
# resize2fs /dev/lvmSystem/volHome
And also, maybe I should remove the swap volume from my fstab (?).
I wrote this topic just want to make sure the sequence I elaborated is correct, and whether or not this can be performed while the laptop is on and the partitions are mounted.
I recently switched to the linux-hardened kernel on Arch, and it currently does not support hibernation (see https://bugs.archlinux.org/task/63648). So, those 8G of swap are currently useless as I plan to stick to the Hardened kernel (I plan on re-compiling the hardened kernel to enable hibernation support, but not in the near future).
And also, maybe I should remove the swap volume from my fstab (?).
I wrote this topic just want to make sure the sequence I elaborated is correct, and whether or not this can be performed while the laptop is on and the partitions are mounted.
Never resize partitions when they are mounted as it will cause dataloss. You should boot with a LiveCD and do the operations from there. Also ensure that you have a verified backup before making the changes in case things go wrong.
Never resize partitions when they are mounted as it will cause dataloss. You should boot with a LiveCD and do the operations from there. Also ensure that you have a verified backup before making the changes in case things go wrong.
Ok, thank you. Concerning the commands I wrote, are they correct? Or is there something to be changed?
Never resize partitions when they are mounted as it will cause dataloss. You should boot with a LiveCD and do the operations from there. Also ensure that you have a verified backup before making the changes in case things go wrong.
The general sentiment is ok (backup, then play), but the assertion is not. Resizing online with modern filesystems is fine - ext4 included.
lvextend accepts the " -r" parameter to manage the filesystem resize concurrently.
I am not familiar with lvdestroy - lvremove maybe ?.
The general sentiment is ok (backup, then play), but the assertion is not. Resizing online with modern filesystems is fine - ext4 included.
I am not familiar with lvdestroy - lvremove maybe ?.
That's also what I knew. However, since I found a few diverging opinions online I decided to double-check before attempting.
Quote:
Originally Posted by syg00
I am not familiar with lvdestroy - lvremove maybe ?.
You must disable the swap partition before you remove it.
The swapon command will tell you if it is active, and if so then the swapoff command should disable it.
If it was active then check /etc/fstab to see if it is listed as swap there and remove the entry so it does not activate on the next boot.
If the swapoff command was able to disable that partition then the lvremove command can be used to free up that space within the VG. It might however require a reboot after the /etc/fstab changes to ensure it is not in use; then do the lvremove.
Finally the lvextend command as shown in post #6 above can be used to expand the LV and fill the newly released space. All should be able to be done with the system active as long as the swap space is not actively being used.
Use 'man swapoff' or 'man swapon' to check all that is documented for those tools.
Last edited by computersavvy; 09-19-2022 at 02:49 PM.
The general sentiment is ok (backup, then play), but the assertion is not. Resizing online with modern filesystems is fine - ext4 included.
lvextend accepts the " -r" parameter to manage the filesystem resize concurrently.
I am not familiar with lvdestroy - lvremove maybe ?.
Just because you can doesn't mean you should. Resizing mounted partitions is technically feasible as you mentioned but is potentially risky enough that most partitioning software stop you from resizing a mounted disk. I tested with gparted and it wouldn't allow me to resize a mounted partition and only after I unmounted it I was allowed to resize.
The time savings you would get from resizing a mounted Root partition are miniscule enough that it is not worth the risk in my opinion. Plus unmounting the root partition will sure cause issues with the functioning of the OS anyways so there is that...
The time savings you would get from resizing a mounted Root partition are miniscule enough that it is not worth the risk in my opinion. Plus unmounting the root partition will sure cause issues with the functioning of the OS anyways so there is that...
Enlarging a mounted ext4 filesystem is a routine and quite safe operation. The existing structures that would need to grow (the block group descriptor tables) are by default created with enough space reserved to allow the filesystem to grow to 1024 times its initial size.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.