Need Help With My Filesystem (SOLVED)

A

aquashift

Guest
Hello all, I've had great success using these forums for fixing problems I've had in the past, so I'm giving it another go.
I have a logical volume filesystem.
I need to enlarge one of my partitions/LVs to make room.. it's 30g capacity is now full. When I first installed the my OS, I had it partitioned so that my /etc, /usr, and /root directory trees were on a smaller partition, and my /home was on the biggest partition.

I foolishly tried copying my /etc and /usr directory trees over to my /home directory.. but I don't need help with the cleanup of that disaster.. that's already taken care of.

I need help enlarging my volume/partition that only has 30G on it.

Here is some info on my filesystem:

at the terminal:

Code:
[email protected]:/etc# vgdisplay
--- Volume group ---
VG Name KandA-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 465.52 GiB
PE Size 4.00 MiB
Total PE 119173
Alloc PE / Size 119173 / 465.52 GiB
Free PE / Size 0 / 0
VG UUID epV82A-6It2-kfKs-uJ1q-HEsn-3j4L-b8VB2N
and

Code:
[email protected]:/etc# lvdisplay
--- Logical volume ---
LV Path /dev/KandA-vg/root
LV Name root
VG Name KandA-vg
LV UUID 87EScU-sFY9-3utM-mOeR-RnzL-9X5Y-9vVabt
LV Write Access read/write
LV Creation host, time KandA, 2016-07-12 19:50:34 -0600
LV Status available
# open 1
LV Size 27.94 GiB
Current LE 7152
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0

--- Logical volume ---
LV Path /dev/KandA-vg/swap_1
LV Name swap_1
VG Name KandA-vg
LV UUID vO6Hk8-cAoG-1o6w-2V2k-wD8d-3bmo-UJI5mM
LV Write Access read/write
LV Creation host, time KandA, 2016-07-12 19:50:34 -0600
LV Status available
# open 2
LV Size 11.64 GiB
Current LE 2979
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1

--- Logical volume ---
LV Path /dev/KandA-vg/home
LV Name home
VG Name KandA-vg
LV UUID F9aKJO-KNds-R2Nd-9weh-Lkgw-9HNV-fNU9jm
LV Write Access read/write
LV Creation host, time KandA, 2016-07-12 19:50:34 -0600
LV Status available
# open 1
LV Size 425.95 GiB
Current LE 109042
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:2

Still at the terminal:

Code:
[email protected]:/etc# blkid
/dev/sda1: UUID="371b8f2f-ccef-40d8-80ca-df20139f123b" TYPE="ext2" PARTUUID="b1ae3941-01"
/dev/sda5: UUID="GfTMEG-NPCe-Vkw3-cbqp-nXOs-Bcrm-zcnqzF" TYPE="LVM2_member" PARTUUID="b1ae3941-05"
/dev/mapper/KandA--vg-root: UUID="2c26bd85-0f96-4800-a09d-a81cda07d35c" TYPE="ext4"
/dev/mapper/KandA--vg-swap_1: UUID="ccc5dfea-29eb-468a-ae4b-9e4b6c6f9e85" TYPE="swap"
/dev/mapper/KandA--vg-home: UUID="f7928f21-5453-4cbf-a215-2cd4c3783e76" TYPE="ext4"

My /etc/fstab file contains this:

Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/KandA--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=371b8f2f-ccef-40d8-80ca-df20139f123b /boot ext2 defaults 0 2
/dev/mapper/KandA--vg-home /home ext4 defaults 0 2
/dev/mapper/KandA--vg-swap_1 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
Thanks in advance.
 


R

ryanvade

Guest
How about this:
Code:
pvresize /dev/sdaX
where X is the partition and works if the volumes is offline.
 
A

aquashift

Guest
How about this:
Code:
pvresize /dev/sdaX
where X is the partition and works if the volumes is offline.
Ok cool. I will try this, ryan, thanks so much.
So, how do I figure out which partition to pvresize? I mean, I know that, using Krusader, my '/', '/usr,' '/etc,' and /root trees are in the partition that is filled up, and that my '/home' directory tree seems to be in the partition that has the bulk of my HDD space, but which sdx do I pvresize? Can you tell me from the lvdisplay and/or vgdisplay and/or blkid commands and data I posted?
 
A

aquashift

Guest
If you look at the file I uploaded here, you'll see I have dm-o, dm-2, and sda1, and the dm-o is what needs to be resized. sda1 is my main bulk of the HDD, and dm-2 is the swap(???)
 

Attachments

R

ryanvade

Guest
Ok cool. I will try this, ryan, thanks so much.
So, how do I figure out which partition to pvresize? I mean, I know that, using Krusader, my '/', '/usr,' '/etc,' and /root trees are in the partition that is filled up, and that my '/home' directory tree seems to be in the partition that has the bulk of my HDD space, but which sdx do I pvresize? Can you tell me from the lvdisplay and/or vgdisplay and/or blkid commands and data I posted?
I can't say for certain which should be changed.
 
A

aquashift

Guest
How about after my last post and attachment? should my code be:
Code:
sudo pvresize dm-0
 
R

ryanvade

Guest
If you look at the file I uploaded here, you'll see I have dm-o, dm-2, and sda1, and the dm-o is what needs to be resized. sda1 is my main bulk of the HDD, and dm-2 is the swap(???)
dm0 and dm2 are not physical partitions. If you are wanting to increase physical partition sizes use pvresize, if you want to increase a logical volume size use lvresize. Then afterwards grow the actual filesystem.
 
A

aquashift

Guest
Thank you so much ryan for your help. I've solved it.

Ok so my issue was that when I created my OS, the installation USB I was using asked me if I wanted to partition my drive with logical volumes as an option. I chose yes. It then asked me if how I would like to partition my drive, and I chose for it to be partitioned into two major partitions, which also happened to include a third, small, swap partition.
So I had a 30G "root" partition, a 350G "home" partition, and a small swap.
I began installing a LOT of stuff onto my machine, not just packages using apt-get on the command line, but also downloading source code for fairly large programs that I would build and make.
So eventually I ran out of space in my 30G root partition.
The simple fix for this, that I found, is to use a live USB to boot from, download a logical volume management program:

Code:
sudo apt-get install system-config-lvm
Then run it:

Code:
sudo system-config-lvm
It has a gui, so it's very easy to use. You click on the logical volume that has the bulk of your HDD, and/or the volume you can spare some space to give to the volume that is running out. This volume you have to decrease in space. I decreased mine by 50gigs. Then I clicked on the logical volume that needed to be increased, my 'root' labelled volume. I increased that by the difference.
So my new 'root' partition is now 90G, my 'home' partition is now 300G, and my swap is exactly the same because I didn't mess with it.
Please keep in mind that if you're going to resize your partitions/volumes, they must be currently unmounted and unused, thus you must be doing this from a utility disk or a live USB.
After I resized those 2 partitions, I rebooted, and everything is fine.
Cheers
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Latest posts

Top