LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Move space in partition to /home (https://www.linuxquestions.org/questions/linux-software-2/move-space-in-partition-to-home-4175644668/)

cad-guy 12-20-2018 02:17 PM

Move space in partition to /home
 
1 Attachment(s)
Hello;
I hope that someone can help me with a not too detailed fix for an install problem. Yesterday I did a new install of Parrot-Linux (for internet security). I did a manual installation because my goal was to put the OS on it's own partition while the files/data went on the main drive. The computer is Lenovo B570 and it was installed on a 1Tb drive. I created a 50Gb partition for the OS with the rest supposedly for data files. Yet when I started transferring files to the drive, I found that it quickly filled.
I'm using the most recent distro of Parrot linux with Mate desktop environment. Typing 'lsblk -l' into terminal gave me this:
NAME || MAJ:MIN || RM || SIZE || RO || TYPE || MOUNTPOINT
sda || 8:0 || 0 || 931.5G | 0 || disk
sda1 || 8:1 || 0 || 512M || 0 || part || /boot/efi
sda2 || 8:2 || 0 || 244M || 0 || part || /boot
sda3 || 8:3 || 0 || 930.8G | 0 || part
sr0 || 11:0 || 1 || 1024M || 0 || rom
parrot--vg-root | 253:0 || 0 || 14.9G || 0 || lvm || /
parrot--vg-swap | 253:1 || 0 || 3.9G || 0 || lvm || [SWAP]
parrot--vg-home | 253:2 || 0 || 27.8G || 0 || lvm || /home


What I hope is to be able to allocate the space in sda3 to the parrot--vg-home area. Can this be done without re-installing the OS?

I thank you in advance for any advice.

syg00 12-20-2018 03:21 PM

The good news is that you have used LVM to handle your "partitions" - this is exactly why LVM was developed. Run these for us - use [code] tags when posting output to preserve the layout so we can read it; use "Go Advanced" then the "#" button.
Code:

sudo parted /dev/sda "print free"
pvs
vgs
lvs


cad-guy 12-20-2018 05:26 PM

partition details
 
4 Attachment(s)
syg00
Thank you. I did set up LVM on the chance that I messed up somehow. Here is all the info. I hope that it brings some greater clarity.

syg00 12-20-2018 05:50 PM

Essentially all the disk is available to LVM, so you can simply use lvresize to add space to any lv. I mention that because you may need to increase the root in the not too distant future. On any sensible linux filesystem, increasing the size can be done on-line - the following should add 100 Gig to /home (I don't generally use LVM, so I stand to be corrected). If it fails, no harm done.
Code:

sudo lvresize -r -L+100G parrot-vg/home
There are a bunch of LVM guides on the net, RHEL have a very good one available for free download. If you use "df -hT" you can see the size and usage of all your mounted filesystems. Before and after will show the increase.

rknichols 12-20-2018 05:52 PM

It looks like partition sda3 is already part of the parrot-vg volume group and has plenty of space available (884 GB). You can add some or all of that space to the /home filesystem.
Code:

##  Addng a specific amount:
lvextend --size +40G --resizefs parrot-vg/home

##  Adding all the currently free space in the volume group
lvextend --extents +100%FREE --resizefs parrot-vg/home

You can look at the manpage for lvextend for other options. Note that this operation is best done online, with the filesystem mounted. That way, the current LVM state will be saved in /etc/lvm/backup in case you need to revert the change, but note that shrinking an xfs filesystem is not possible.

(syg00 posted essentially the same thing while I was typing, "-r" is the short option for "--resizefs", and "-L" is the short for "--size".)

cad-guy 12-22-2018 03:04 PM

1 Attachment(s)
It worked!
Thank you everyone so very much.
Both 'lvresize' and 'lvextend' worked to correct the problem.
I can't tell you how great it is to finally have this HD working properly after so many problems.
thanks again

cad-guy 12-27-2018 07:31 PM

I would love to ask you all for one more question.
How can I change 'lvresize' or 'lvextend' in order to expand the cache? I think that the way I set it up does not leave enough space there since programs are running slower then they did with linux mint.

Thank you again.

syg00 12-27-2018 10:10 PM

Yet another example of the xyproblem.

Start another thread, stating your request and any evidence you have. Don't tell us the solution you require.


All times are GMT -5. The time now is 04:01 AM.