LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-20-2018, 02:17 PM   #1
cad-guy
LQ Newbie
 
Registered: May 2012
Posts: 24

Rep: Reputation: Disabled
Move space in partition to /home


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.
Attached Thumbnails
Click image for larger version

Name:	tmp-linux-partition.png
Views:	20
Size:	35.7 KB
ID:	29252  

Last edited by cad-guy; 12-20-2018 at 03:27 PM. Reason: clarity of table
 
Old 12-20-2018, 03:21 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,160

Rep: Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341
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
 
Old 12-20-2018, 05:26 PM   #3
cad-guy
LQ Newbie
 
Registered: May 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
partition details

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.
Attached Thumbnails
Click image for larger version

Name:	linux-partition-chk1.png
Views:	23
Size:	52.1 KB
ID:	29253   Click image for larger version

Name:	linux-partition-chk2.png
Views:	20
Size:	15.3 KB
ID:	29254   Click image for larger version

Name:	linux-partition-chk3.png
Views:	19
Size:	14.9 KB
ID:	29255   Click image for larger version

Name:	linux-partition-chk4.png
Views:	17
Size:	25.4 KB
ID:	29256  
 
Old 12-20-2018, 05:50 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,160

Rep: Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341
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.
 
Old 12-20-2018, 05:52 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,453

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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".)

Last edited by rknichols; 12-23-2018 at 08:22 AM. Reason: remove extraneous space in code
 
Old 12-22-2018, 03:04 PM   #6
cad-guy
LQ Newbie
 
Registered: May 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Smile

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
Attached Thumbnails
Click image for larger version

Name:	linux-partition-resolved.png
Views:	22
Size:	57.8 KB
ID:	29269  
 
Old 12-27-2018, 07:31 PM   #7
cad-guy
LQ Newbie
 
Registered: May 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
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.
 
Old 12-27-2018, 10:10 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,160

Rep: Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341Reputation: 3341
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.
 
  


Reply

Tags
linux boot, partitioning


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to move pointer allocated in kernel space to user space. Phuti Programming 3 07-31-2018 10:14 AM
[SOLVED] Move file names with space to other directory with different file name with space pradeepdee6 Linux - Newbie 9 08-08-2012 09:19 AM
Can I move /home partition under root partition arijit_2404 Linux - General 3 07-05-2007 12:01 AM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration