LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LVM with LUCKS need help to modify the partitions (https://www.linuxquestions.org/questions/linux-newbie-8/lvm-with-lucks-need-help-to-modify-the-partitions-4175557175/)

TarnaBar 10-26-2015 06:48 AM

LVM with LUCKS need help to modify the partitions
 
As the title states I need help to modify my partitions , I installed the BackBox distro some weeks ago and followed the installation guide without going in depth , I am pretty sure of creating a entire LVM partition + encryption with LUCKS , problem is that following the guide I skipped the swap partition part, which is quite annoying because every time I boot the pc asks me to skip mounting the swap. I doesn't affect the performance of my pc very much , but I like things clean and well done. Now my question is how to cut a 2-5Gb out of my main partition and create a swap one , under the same LVM tree and under the same encryption ? It's the first time I use LVM so let's say I have no idea how this works. I am pretty sure that Gparted would do a mess and I can't figure by myself how to use Fdisk or other programs to get the job done.
If anyone can spend 30 minutes of telling me the procedure step by step and explaining me also every command you use so I could do it by myself in future I'd be grateful. :)

Image1
Image2
Image3

JeremyBoden 10-26-2015 08:15 PM

Create yourself a swap file instead of a swap partition.
Marginally less efficient, but swap doesn't get used anyway.

syg00 10-26-2015 09:06 PM

According to those images you already have a swap lv. Explain in detail what messages you are getting and when. Screenshots would probably be best. Also post your /etc/fstab and any boot parameters.

TarnaBar 11-16-2015 07:07 AM

Solution
 
For anyone struggling with LVM and how it works follow this GUIDE it explains in detail the basic usage and commands.

If you must modify let's say a LVM Encrypted partition that is not mounted you will probably want to try this :

cryptsetup luksOpen /dev/sdX lvm

(sdX stands for your partition name use: 'lsblk' , 'fdisk -l' to see your actual partitions and their names use 'df -h' to see mounted partitions and their mount points) [ lvm is how will the system map it in the /dev/mapper ]

then you probably must use

sudo pvscan

( this scans for physical volumes that use LVM )

sudo vgscan

( this scans for volume groups )

sudo lvscan

( this scans for logical volumes )

sudo vgchange -a y

( this activates any volume group if none is specified )

after this you should probably be able to modify your partition following the first guide examples.

//Please don't just copy and paste the commands , it's not ideal for working with linux , worse when using the root user , so more when playing with partitions of your hard disk! // Try to understand what are you doing first :*

JeremyBoden 11-16-2015 09:43 AM

It's actually quite instructive to run LVM on a USB key - partition it into a couple of partitions.
These are your several physical disks.
Create a single volume group.
Then create a number of logical volumes and put a file system such as ext4 on each one.
Create files etc and then work out your backup strategy.

With a small amount of care, you can't do any damage. :)


All times are GMT -5. The time now is 10:53 PM.