You are not logged in.
The features el_koraco outlines show the obvious benefits, it's up to you how you utilise them. So let me re-phrase... "Nor should yours if you need the flexibility it provides".
Being able to extend volumes over different hard drives is also pretty cool.
Offline
It's possible to encrypt a LVM partition? I used this guide to encrypt my /home partition, but if I reinstall and use LVM, I would encrypt during install?
Yup! I just finished doing this on my waldorf netbook. As el_koraco said, the installer itself offers encryption...it says something like
use whole disk
use whole disk with LVM
use whole disk with LVM and encryption
manual
My statler laptop is the whole disk, so I used the third option when I installed that (worked great!). My waldorf netbook still has the OS it came with on another partition, so I used manual and did the LVM and encryption stuff by hand. It was still pretty easy. I have an unencrypted /boot partition, but everything else for #! (including swap) is inside the encrypted LVM. At the end of the install, I told it to write grub to /boot instead of the MBR.
Offline
^ That's awesome. I wanna do that on my next install for sure.
Why did you put grub on /boot?
• Support #! • Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •
Offline
^ It's (in part) a legacy issue; grub originally did not work from LVM. I don't know if it will work from an encrypted partition.
"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe
Offline
Why did you put grub on /boot?
I have the TrueCrypt bootloader on the MBR, so I have it choose between booting Windows from the TrueCrypt volume or grub from the plain /boot partition. When I choose the latter, grub is booting the encrypted LVM for me (TrueCrypt is no longer involved). I don't know if I could have done it all with grub on the MBR, but I knew this would work (as PackRat implied, this even works with grub 1) and it was already half done (I created the LVM as part of the waldorf install...the rest of the partitions were already laid out this way).
Offline
can i access (mount) lvm partitions from the #! live disc
i ran out of space on /usr and now i have an unusable machine
cant open terminal or anything
so i figured i'd just grow it a couple GB with a live disc and away i go
sound workable?
So come up to the lab...
And see what's on the slab
Offline
Sure, just make sure you install lvm2 (I'm not sure how the #! live CD is set up, the Debian live CD loads the lvm module if the kernel detects logical volumes. A quick Google on "mount lvm volume" will give you results like these:
http://linuxers.org/howto/how-mount-lin … ions-linux
system-config-lvm is a tool which can help you with a GUI.
Offline
el_koraco, thanks for this LVMonument.. 
I have decided to give LVM a shot for a fresh Waldorf install. Following your instruction, everything was setup just fine. My only doubt is related to the fact that fdisk -l outputs something like
Disk /dev/mapper/debian-home doesn't contain a valid partition tablefor each one of the LV...have I missed some important setting?
We are a nice, friendly community here and I hope we stay that way.. 
Offline
Morning All,
After borking my system I reinstalled using LVM and this magnificent guide.
I am now trying to syncronise Dropbox to /home but am told that Dropbox cannot sync because of lack of space.
So I have done
lvextend -L75GB /dev/debian/home
to give me a 75GB /home which is ample room for Dropbox. Lvdisplay gives
--- Logical volume ---
LV Path /dev/debian/home
LV Name home
VG Name debian
LV UUID pBz8df-AEAw-6Sha-QxWg-IvBV-mfNP-DqzR7M
LV Write Access read/write
LV Creation host, time daddy, 2012-10-09 14:37:05 +0100
LV Status available
# open 1
LV Size 75.00 GiB
Current LE 19200
Segments 3
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1
To show that I'm at 75 GB for /home. However Dropbox still won't sync.
What am I missing?
All help gratefully received.
Simon
I didn't say it was your fault... I said I was going to blame you.
Offline
You need to extend the filesystem on the partition. As root:
resize2fs -p /dev/debian/homeOffline
I don't even use LVM currently, but this thread is seriously monumental. Real knowledge!
Offline
You need to extend the filesystem on the partition. As root:
resize2fs -p /dev/debian/home
Was exactly what I was missing...Thank you 
I didn't say it was your fault... I said I was going to blame you.
Offline
No prob. Welcome to the forums.
Offline
Flexible installing of new distros (a personal example)
So, a few weeks ago I decided to switch to Sid. I had a 50 GB /home LV in Squeeze, most of which was used for music. Since I wanted as little fuss as possible with Sid, and wasn't sure if I would keep Sid, I decided to move things around a little. First I made a new LV for hosting my music files and formated it to ext4:
root@mrdeb: lvcreate -L40G -n music /dev/debian
root@mrdeb: mkfs.ext4 /dev/debian/music Then I used Thunar to copy all my music on the new logical volume. Next, I made a snapshot and backup of my Squeeze root partition, as per lesson nr 4 on page one, and a new LV for sid, with ext4:
root@mrdeb: lvcreate -L10G -n sid /dev/debian
root@mrdeb: mkfs.ext4 /dev/debian/sid I booted the installer, installed everything under a single root partition. I transferred all my settings from my Squeeze /home LV to my new install. Then I made two directories in my new home and gave permission to my user:
root@mrdeb: mkdir -p /home/elkoraco/music /home/elkoraco/videos
root@mrdeb: chown elkoraco:elkoraco /home/elkoraco/music
root@mrdeb: chown elkoraco:elkoraco /home/elkoraco/videos
I added these two lines to my fstab, so the system would mount the video and music LVs in /home/elkoraco:
/dev/mapper/debian-video /home/elkoraco/videos xfs relatime 0 2
/dev/mapper/debian-music /home/elkoraco/music ext4 noatime 0 2Some days later, after deciding to stick with Sid, I wanted to nuke my Squeeze partitions. I do have a backup, so in case I want to go back, it will be a piece of joke:
root@mrdeb: lvremove /dev/debian/root
root@mrdeb: lvremove /dev/debian/homeThis kind of migration can be done regardless of distro, as long as it has LVM support in the installer, and it makes our lives a million times easier.
Last edited by el_koraco (2012-11-13 16:32:12)
Offline
This is a very nice guide, especially the backup thing. I have a question.
My partition table looks something like this:
GRUB is installed on the MBR
70 GB ntfs Windows 7
100 GB ntfs data
250 MB /boot
~250 GB extended partition containing
1 encrypted lvm partition containing
1 vg with root/swap/home pv'sIf I decide to install a second linux distro in a new vg, will there be any problems, if it shares my current /boot partition, or should there be one /boot for each OS within the encrypted lvm partition?
Offline
Shouldn't be a problem. Though I'd rather install Grub to the new distro's root, and chainload from the Debian Grub (it's a simple update-grub) to avoid any potential problems.
Offline
I'm no sure I understand why I should install grub on the second distro's root. I have grub on the MBR, and I have a /boot outside the LVM, because I was told I had to, due to the encryption. This makes me a bit confused..
I think the easy way to do it is to install the second distro on a separate ext4 partition outside the lvm, but inside the extended partition.. That way, I can leave it as it is, and grub will be able to finde it. It would just be for hopping anyways..
Offline
Ah, you mean encrypted. No idea about that one. It may be you need to have the distros share the boot partition in that case.
Offline
El_koraco, here I report yet another extremely satisfied 'customer' of your MONUMENTAL LVM guide. It is so clearly written that even I, iMBeCil, was able to get it in the first attempt.
I vote for 'sticky'!
BTW, LMV is not only handy, it is even FUN to play with: want to resize/enlarge? No problem: see this guide. Want the new partition? No problem: see this guide. Want to destroy your data? No problem: see this guide
(Just installed new Waldorf on 'production' laptop, ext4 / and /home, two large XFS for photo pictures and VBox HDD ...)
Postopone your duties; if you die, you won't have to do them ..
Offline
Oho, ti si još i domaći.
Offline
^ Dakle, ako se sad nisam šlagir'o ... nikad se neću.
But, let's not be rude ... and let's not talk in langauge other don't understand ... 
Postopone your duties; if you die, you won't have to do them ..
Offline
Using either the #! or the GRML live sessions from DVD or CD, upon attempting the restore process, it fails at the point of mounting.
mount /dev/debian/backup /mnt/restore... giving me the error "mount: special device /dev/debian/backup does not exist".
How do I make it available? Using lvdisplay shows all the lvm partitions, but they are not shown as being "available".
Knoppix actually did not give me that error and mounted the lvm partitions, but it could not find the fsarchiver file to install, and I wasn't certain at all how to add a repository to its list. (Still feeling a little 'duh' in there...)
I succeeded in creating the backup after enlarging my backup volume to 6GB, but now am failing in the trial restoration step.
Everything else is working beautifully! Thanks for this excellent tutorial!
Terry
#! Lover
Offline
There seems to be some kind of problem with the current version of Grml. I think the daily releases should work properly.
Offline
I just tried a daily build and it didn't work yet.
Not sure how to add a repository to Knoppix so I can install fsarchiver, but I'll figure that out - seems it will be my best bet right now.
Terry
#! Lover
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.