LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-26-2015, 06:48 AM   #1
TarnaBar
LQ Newbie
 
Registered: Oct 2015
Location: Italy
Distribution: Debian, Ubuntu, BackBox, Kali Linux, Arch Linux
Posts: 17

Rep: Reputation: 0
Question 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
 
Old 10-26-2015, 08:15 PM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Create yourself a swap file instead of a swap partition.
Marginally less efficient, but swap doesn't get used anyway.
 
Old 10-26-2015, 09:06 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,134

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.
 
Old 11-16-2015, 07:07 AM   #4
TarnaBar
LQ Newbie
 
Registered: Oct 2015
Location: Italy
Distribution: Debian, Ubuntu, BackBox, Kali Linux, Arch Linux
Posts: 17

Original Poster
Rep: Reputation: 0
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 :*

Last edited by TarnaBar; 11-16-2015 at 07:12 AM.
 
Old 11-16-2015, 09:43 AM   #5
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

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


Reply



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
LVM Partitions are equals to OS partitions? xeon123 Linux - Newbie 1 05-26-2011 06:45 PM
How to multiboot distros from LVM and/or Non-LVM partitions? kennybobby Fedora 2 12-07-2010 06:58 AM
I can't modify the partitions on my laptop's hard drive Dark Jirachi Linux - General 3 08-25-2007 05:00 AM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:48 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