Extending an LVM Logical Volume to Another Disk

I have read the article in the wiki and also this guide since my drives are encrypted. I have already set up arch on one drive with LVM on top of an encrypted volume (following the linked guide strictly with exceptions on the cipher and the partitioning). So far everything works very well but I'm only halfway where I want to end up. Additional to the one HDD I want to use two more, all of them encrypted (no problem here) and one logical volume spread across all three drives (problem be here).
So, to clarify, on /dev/sda I have two partitions, /boot (unencrypted, 130 MB) and /dev/sda2 (encrypted, ~2TB) on which the LVM volumes are.
/dev/sda2 is added to vgroup and has several logical volumes of which /home is the largest.
On the other hand I have /dev/sdb and /dev/sdc. Both should only contain one encrypted partition and extend /home. That is why I chose LVM in the first place.
I started with /dev/sdc since all the data on it has been backed up already. The entire drive is now one big encrypted partition called /dev/sdc1. I mounted it with sudo cryptsetup luksOpen /dev/sdc1 lvm. And here I am stuck.
1) First of all I'm not entirely clear on the last part "lvm" of that command, I initially thought it would be the name this partition would be mounted under but in the guide I took this from it is not explained and I want to be extra careful here because I have a lot of data on /dev/sda2 that is not backed up and I don't want to accidentally erase the logical volumes I already have.
2) I guess the next part would be creating a physical volume on the mounted partition via lvm pvcreate /dev/mapper/lvm but again I want to be extra clear on this, I really do not want to temper with the volumes I already have unless I know exactly what effects it will have. If I would mount the encrypted partition with sudo cryptsetup luksOpen /dev/sdc1 aaa would I then have to create the physical volume with lvm pvcreate /dev/mapper/aaa? Because I already used lvm when I created all the volumes on the first drive (sda) and I don't know if they are still mounted under the same name (after many reboots and setting up the arch which I am currently using) in which case I might be in danger of overwriting something?
3) From what I have read so far I could extend /home now with lvextend -l +100%FREE vgroup/home, is that correct? After that I would only have to extend the file system (ext4) on /home and it would be done?
I hope it is clear what I am trying to do, if not please do ask. Thanks in advance for reading all of this.

Turns out this is not quite over yet. After successfully dealing with LVM I was about to reboot when something occurred to me: The second HDD (sdc1) will not be decrypted at boot and I have no idea what would happen if LVM tries to mount a volume that is spread across two disks of which one is not available.
So I searched for some time and everything I could find was this thread. Well, he is talking about altering the encrypt hook and generate a new initramfs to be able to enter more than one cryptdevice in grub. I have never dealt with hooks before and never got my hands on bash script like this. Now my options are pretty weak: I could do what he describes although I have no idea how it works or I could revert all the changes to LVM. Naturally I chose option number one, parsed the hook, edited the menu.lst, rebooted and "Waiting 10 seconds for device /dev/sda2".
So yeah it's my fault for trying something I have no clue about.
I tried to access the volumes from the live cd, but even though I decrypted the drives and loaded up lvm with vgchange -a -y I can not access the logical volumes. I naively tried to access the files such as menu.lst but I can't get there. Probably because I just lack the knowledge how to do that. But even if I would be able to access the files, could I build the hooks of my system from within the live cd?
Last edited by venehan_snakes (2011-10-18 16:49:48)

Similar Messages

  • Extending LVM logical volume

    Hi I recently added a new hard drive to my computer which had an existing LVM on the first drive.
    I created an LVM physical volume on my new hard drive and added it to my existing volume group (volgroup)
    pvcreate /dev/sdb1
    vgextend volgroup /dev/sdb1
    I then proceeded to extend one of LVM logical volumes so that it used all the free space on my volume group (volgroup)
    I tried
    lvextend -l 100%FREE volgroup/home
    but this didn't extend the volume (it stayed the same size)... but
    lvextend -l +100%FREE volgroup/home
    did. What I don't understand is why. The description of the -l option is as follows
    -l, --extents [+]LogicalExtentsNumber[%{VG|LV|PVS|FREE|ORIGIN}]
    Extend or set the logical volume size in units of logical extents. With the + sign the value is added to the actual size
    of the logical volume and without it, the value is taken as an absolute one. The number can also be expressed as a per‐
    centage of the total space in the Volume Group with the suffix %VG, relative to the existing size of the Logical Volume
    with the suffix %LV, of the remaining free space for the specified PhysicalVolume(s) with the suffix %PVS, as a percent‐
    age of the remaining free space in the Volume Group with the suffix %FREE, or (for a snapshot) as a percentage of the
    total space in the Origin Logical Volume with the suffix %ORIGIN.
    As far as I can see the "+" only makes sense when setting the logical volume size in units of logical extents. If you're using %FREE that should be the percentage of free space of the volume group.
    Any ideas?

    --- Logical volume ---
    LV Name /dev/volgroup/home
    VG Name volgroup
    LV UUID PjPjuh-lPuN-j79Z-OIdI-ZniR-NOQT-NiRGbc
    LV Write Access read/write
    LV Status available
    # open 1
    LV Size 1.65 TiB
    Current LE 433488
    Segments 2
    Allocation inherit
    Read ahead sectors auto
    - currently set to 256
    Block device 254:4
    It was originally ~900GiB. Thanks for your explaination.

  • RAID on LVM logical volumes

    Hey,
    i've got a 1T and a 500G hard drive in my workstation. The 500G drive is my media disk. I initialized a software RAID-1 with one missing drive on a 500G logical volume on the 1T disk. After formatting and copying all the data from the media disk over to the new raid partition, I added the old 500G partition to the RAID.
    After rebooting my machine, the RAID was in inactive state and hence the filesystem could not be mounted.
    I found out, that in /etc/rc.sysinit the search for software RAID arrays is performed before the search for LVM volume groups. I started switching the RAID and LVM sections but after reboot nothing changed. I presume it's caused by the lv devices missing in /proc/partitions, which is used by md to scan for raid members by default.
    I decided to add some lines to /etc/rc.local (also my RAID device is /dev/md127 Oo):
    mdadm --stop /dev/md127
    mdadm --assemble /dev/md127 /dev/vg00/raid-data /dev/sdb1
    mount /mnt/raid
    It works now, but it is not a clean solution.
    How is it supposed to do RAID on top of LVM logical volumes in Arch Linux? Are there any alternative ideas of solutions to this problem (sure there are)?
    Thanks in advance.

    delcypher wrote:
    Hi I've been looking into backing up one of my LVM logical volumes and I came across this (http://www.novell.com/coolsolutions/appnote/19386.html) article.
    I'm a little confused by it as it states that "Nice work, your logical volume is now fault tolerant!".
    Are you sure that's the article? I can't find anything on that page about "nice work" or "fault tolerant"...?
    delcypher wrote:My concern is that because my volumegroup spans across two drives if anyone of them fails I will loose all may data.
    Correct.
    delcypher wrote:Is there any setup I can do by which I can have a perfect mirror of my volumegroup so that if one of my drives fail I still have a perfectly function volumegroup.
    Use 2 disks to create a RAID-1 array, then use that as your PV.
    sda1 + sdb1 = md0 => pv
    delcypher wrote:I understand linux supports software raid but would I need two drives identically sized (1TB) or can I just have one drive (i.e. 2TB) that is a mirror of my volumegroup?
    You can use 2 partitions on the same disk to create a RAID array, but that defeats the whole purpose of RAID.
    It sounds like you're merging the meanings of 'redundant' and 'backup' -- they are distinct things, so you need to decide if you want redundancy or backup. Or both ideally.

  • Linux LVM (Logical Volume Manager) for CentOS on Azure?

    Hi.  I am trying out Azure and installed a OpenLogic CentOS 6 virtual machine.  I note that it is not running LVM (Logical Volume Manager) by default.  I would like to ask if it is possible to:
    1. have CentOS Linux installed with LVM by default when creating a Linux virtual machine on Azure
    2. switch to LVM after adding a new disk
    On the other hand, is it a good idea to use LVM at all?  Will it affect performance, features on Azure?
    Thanks.

    Hi,
    Based on my experience, you can add disk to an Azure VM. You can install the Logical Volume Manager to manage the disks attached to the VM. In addition, there is no Linux VM with LVM installed by default. If you want to have this, please submit your requirement
    in Azure feedback:
    http://feedback.azure.com/forums/34192--general-feedback
    In addition, since you can have only one OS system disk for an Azure VM, this limitation may make multi-disk logical volume manager setups unworkable.
    Best regards,
    Susie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • [solved] Filesystem check fail - Cannot access LVM Logical Volumes

    I am getting a "File System Check Failed"on startup, I recently did a full system upgrade but I'm not entirely sure that the cause of the issue as I don't reboot very often.
    I get the error right before this line is echo'ed out:
    /dev/mapper/Arch_LVM-Root:
    The super block could not be read or does not describe a correct ext2 filesystem...
    this is odd because the only ext2 filesystem I have is on an non-LVM boot partition...
    I can log-in and mount / as read/write and I can activate LVM with
    modprobe dm-mod
    and
    vgchange -ay Arch_LVM
    and they show up in lvdisplay but their status is "NOT available"
    I just need to mount these logical volumes so I can retrieve some personal data in my home directory, I am also hesitant to use LVM again if I can't retrieve my data.
    any suggestions?
    Last edited by action_owl (2010-08-15 02:15:58)

    I just popped in the install disk and was able to mount and access the LVM groups as expected, something must have been wonky with my filesystem

  • Want to move 10.8.1 volume to another disk

    I got a faster SATA internal drive for my MacPro and I want to transfer my Mountain Lion volume to it.   Sounds easy, right?
    Well, the original volume is protected by File Vault 2 - and that seems to utterly prevent me from using Disk Utility to "Restore" from the original drive onto the new one - which would have been my preferred method. 
    I always get one of 2 different errors - either "Cannot Verify Source" or "Resource is Busy".    It doesn't matter if I first "Unlock" the source volume or not.
    SO - I tried restoring a Time Machine backup onto the new drive.    That worked (though it took over 7 hours) but to my chagrin - it didn't create the recovery partitions for Mountain Lion.  ARGH!!  
    This not only makes recovery mode unavailable, it also prevents my enabling File Vault on the new drive.    Is there any way to establish those partitions without wiping out the drive??
    What I hope to avoid at all cost is any scenario where I have to do another 7-hour Time Machine recovery.  
    For bonus points: I'd also like to make the existing Time Machine history work with the new volume (i.e. convince Time Machine that it isn't necessary to do another 100% backup from the new drive.)
    Any suggestions would be appreciated.

    Use SuperDuper or CarbonCopy Cloner

  • [solved]Booting a LVM logical volume spanned across two LUKS paritions

    I have two partitions formatted as LUKS that both physical LVM volumes for a logical LVM partition that holds my root filesystem.  I can't seem to figure out what the kernel line should be.  I tried specifying cryptdevice twice, but it seems to only want to take one of the cryptdevice= options.  What now?
    Last edited by synthead (2011-12-09 16:17:06)

    I found this: https://bbs.archlinux.org/viewtopic.php … 95#p827495
    Modifying /lib/initcpio/hooks/encrypt with the patch as recommended did the trick.  I'll file a feature request for this

  • Harddisk appears as logical volume in maverick

    Hi
    After Cloning my OSX Maverick to another Mac (MacPro 2009) I see most of my hard disks, also absolutely new ones (fresh from the package) as logical volumes in the disk utility. I am not so free to partition them as I want for instance.
    I tried the terminal procedure which Linc Davis recommended in another post (sudo diskutil cs ...), it worked, but after a restart I had my hard disks again only visible as logical in disk utility.
    Puh!
    Thanks for Your help
    David

    This is what you do to change "New Volume" back to "Mary's iPod". When "New Volume" is connected to your computer, double click on it. The cursor should appears, you should be able to backspace on your keyboard, erase "New Volume" and type in "Mary's iPod" and then press "Enter".

  • Solaris9 Logical Volume Manager

    Dear All,
    I want to know more about Logical Volume Manager in Solaris9.
    I know that it makes logical volumes from one disk or more?
    are these Logical Volumes like a disk can be used for striping datafiles into them if I use RAID 5 controller in Oracle Database?

    no replies???????

  • [SOLVED] LVM physical volume not available during early boot

    Note to self:
    Of course it's not available - it's in an encrypted LVM container!
    Hi,
    I'm trying to get myself a working hibernate but I'm stuck on resume hook not seeing my swap partition.
    The swap partition is on an LVM logical volume (LV) which is on one physical volume PV created on a different harddrive than the root partition is. During the bootup I get something similar to "ERROR: hibernation partition '/dev/mapper/volgrp-swap' not found".
    Further debugging gave out that for some reason the early userspace has no access to LVM physical volume. I managed to run a shell using break=premount boot parameter. From there I found out that "lvm pvscan" shows no physical volumes at all. I suspect that mkinitcpio does not give a damn about non-root harddrive though I was unable to confirm that and neither was I able to find any other reason for this behaviour.
    Relevant lines from mkinitcpio.conf:
    MODULES="dm_mod btrfs"
    HOOKS="base udev block lvm2 autodetect keyboard encrypt resume filesystems fsck"
    Any help would be appreciated, including any tips on where to get more debug data.
    cheers,
    -miky
    Last edited by mr.MikyMaus (2013-09-25 21:32:32)

    Fackamato wrote:
    Do you have the correct "root=" line in your bootloader's kernel line? Is it in fstab?
    Perhaps try with rootdelay=5 as well?
    Yes I have root=/dev/mapper/hdgroup0-volroot, and its in fstab (not that fstab is even being read)
    root delay wouldn't help at all because after it drops me to a busybox shell I can't do a manual mount.

  • Extend the logical volume

    Hi Everybody
    I my current project no Unix administrator.
    Here system is Oracle Parallel Server in HP-UX environment
    (oracle 8.1.6) and database is created in the RAW devices.
    For the RAW devices volume group is vgoracle. In the volume
    group (vgoracle) all oracle datafiles logical volumes were
    created.
    The problem is, for the system datafile the logical volume name
    is orasystem and the size is 300 MB. I need to increase this the
    orasystem logical volume from 300MB to 1.5GB or 1GB.
    After shutdown the database can I increase the logical volume by
    using the following unix command
    lvextend -L 1500 /dev/vgoracle/orasystem
    If I increase the logical volume is there any possibility of
    database crush. Now the situation is I should not re-create the
    database.
    Regards
    Michael Selvam

    It is related to both because there are oracle datafiles on those raw devices.
    While looking around I found that it seems possible to extend logical volumes on the fly but if there is a file system based on it the file system must support this feature.
    In my case I don't have any file systems on the logical volumes but datafiles,redologs,spfile and control files of an oracle RDMS so the question may regard Oracle as well.
    I post this question here because I imagine that there should be at least one other oracle dba that experienced the same problem.
    For example you've experienced this problem but in a different platform. It seems good to know that its is possible to extend a logical volume in AIX without corrupting the datafiles on it on fly.
    One more thing then. Could you please tell me if adding a disk to a volume group ( the action I should do before extending the logical volume of that group ) is safe like extending a logical volume.
    Thanks
    Bye Alessandro

  • Extend logical volume using diskpart on hardware RAID-5 logical drive in 2003 R2 server

    Hi,
    Can somebody help me.I have succesfully completed my RAID-5 expansion by adding 1 hard drive to the RAID-5 array using HP ACU. I just want to confirm whether I can use diskpart utility to extend my logical volume. Since the Disk management gui does not have
    any extend option.

    Hi,
    Any update?
    Just checking in to see if the suggestions were helpful. Please let us know if you would like further assistance.
    Best Regards,
    Andy Qi
    TechNet Subscriber Support
    If you are
    TechNet Subscription user and have any feedback
    on our support quality, please send your feedback here.
    Andy Qi
    TechNet Community Support

  • Extend C Drive from Another Disk

    Hello,
    I want to extend C drive using un allocated pace from another disk. I have gone through the thread "Extending of C:\ Drive by using un allocated disk space from another volume in Windows Server 2008". But I'm wondering if same can be done on Windows
    Server 2012 R2 ?
    Is there any free third party tool available to perform this task ?

    Hi,
    If the unallocated space is adjacent to the drive that you want to merge. You can add more space to the drive by extending them into adjacent unallocated space on the same disk. It is still apply to windows server 2012 R2. 
    For more detailed information, please refer to the thread below:
    How to Merge unallocated space on disk in two drives in Windows Server 2008 R2?
    http://social.technet.microsoft.com/Forums/en-US/15900843-81e1-47fb-8771-514ee4e0c645/how-to-merge-unallocated-space-on-disk-in-two-drives-in-windows-server-2008-r2
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Disk Utility formats Hard Drives as Logical Volume Group

    I just replaced a hard drive which had died in my Mac Pro which has OS X 10.9.5. To format the new 3TB hard drive I went to Disk Utility. I used "Erase" in its fastest form and the drive was formatted with the Type: Logical Volume Group.
    I remember this was a problem a few years ago when I first put hard drives in this computer. I think it was considered a bug in the Disk Utility in OS X 10.8 that it would automatically format drives greater than 2 TB as Logical Volume Group. The solution for me was to restart the computer with my OS X 10.6 disk and use the Disk Utility in that to reformat the drive. I never really understood why Logical Volume Group was a problem but I just obeyed what the wise ones of the Internet had to say.
    So, now I am wondering if I should reformat my new Hard Drive as GUID using my OS X 10.6 optical disk again? If it was a bug in the Disk Utility of OS X 10.8 then why is it not fixed in the Disk Utility of OS X 10.9? Is there an actual problem with having disks format formatted as Logical Volume Group? Is this now just Apple's way of doing things?
    Thank you.

    keg55 wrote:
    You could do your reformat using your 10.6 DVD. That's a decision that's up to you.
    Not every bug in a previous OS gets fixed in a new OS.
    I don't believe CoreStorage (Logical Volume Group) causes any sort of issues. Whenever one encrypts their Macintosh HD, the format is converted to CoreStorage. Fusion Drives are using CoreStorage and now Yosemite converts portables (laptops) to CoreStorage during the install process. As far as Yosemite is concerned, Apple seems to have gone the route of CoreStorage for portables. Even during the Setup on a portable, FileVault is offered with the default of YES being checked. So, if a customer isn't paying attention and continues with the install, they could encrypt their drive without knowing to uncheck the default checkbox.
    Thank you for your reply.
    I have decided to reformat my new hard drive using my 10.6 disk. I like being able to split it up into more than one volume if need be.
    I understand that not every bug in a previous OS gets fixed, but this strikes me as being really a very large bug, so I think it would be good if Apple addressed it.
    It is useful to know about Yosemite's behaviour. When I upgrade to Yosemite I will be a bit more prepared. In fact my MacBook Pro has FileVault on with Mavericks so Yosemite won't change anything there.

  • Can't delete a logical volume group created from a blank disk image

    Hi all,
    I'm a recent convert from Windows, so do bear with me while I grapple with all the new terminology.
    Basically, here's the problem: I've been trying to create an encrypted drive and have been at it for a few hours now. I ended up with two 'logical volume groups' created from blank disk images, neither of which are password-protected, and one of which I quite stupidly named "hidden folder" and can't rename now. Anyways, I decided to throw it all away and start right from scratch, but now disk utility won't let me delete these two logical volume groups despite me dismounting both devices, trying to trash the containing folder, etc. Some searching about online has gotten me into the belief that there should be an 'erase' tab in the disk utility window which is not showing up when I click on those drives (however, the erase tab does appear when I click on the indented partitions on each drive). Here's a screenshot to give you guys an idea:
    -Here's the disk utility window. The two drives I'm trying to get rid of are "Hidden Folder" and "HD2"
    -Here's what I suppose would be called the 'containing folder' in which both drives reside
    -And finally my setup, just in case it's relevant
    Oh and btw this would be my first post here! How exciting
    Thanks in advance,
    Arthur

    nidra wrote:
    When I right click on it these are the choices: Open; Move to Trash; Get Info; Compress...; Burn ... to disc; Duplicate; Make Alias; Copy ...; Clean Up Selection; Show view options; Label; Folder Actions Setup.
    That is as it should be. If you select "Move to Trash" does it move the folders to the trash? If so, do the following from my previous post:
    tjk wrote:
    1. Open Terminal (in Applications, Utilities).
    2. Copy and paste the following command into the Terminal window (or type it exactly as follows):
    sudo rm -rf ~/.Trash/*
    3. Press Return.
    4. Type in your password when asked (note: you will not see anything being entered as you type your password).
    5. Hit Return.
    6. Wait until the process finishes/the Terminal prompt returns.
    7. Quit Terminal.
    I wonder if I need to do some changes to the rights about doing this action "move to trash"?
    Run Repair Permissions in Disk Utility.
    this is making me very uncomfortable, I know myself to solve any problems I tackle/___sbsstatic___/migration-images/migration-img-not-avail.png Something so simple as this is making me crazy
    I don't know if it would make me any crazier than I am, but I sure wouldn't want a stray folder just hanging around on my desktop either.

Maybe you are looking for

  • How can I get my music on new computer from my Iphone?

    I recently purchased a new computer. I downloaded iTunes and athorized computer but it will not sync with iPhone and load my library on to computer. It recognizes my iPhone when I plug in but when I say "Sync" it does something for a short period but

  • Bug in WITH clause (subquery factoring clause) in Oracle 11?

    I'm using WITH to perform a set comparison in order to qualify a given query as correct or incorrect regarding an existing solution. However, the query does not give the expected result - an empty set - when comparing the solution to itself in Oracle

  • Tracing out an image

    hello forumers. im trying to live trace out this image here,and i like to know which of the settings is the one that doesnt brake the image,and keeps the lines intact im playing around with the various settings,but the results are a bit awkward. than

  • Upgrade Business Catalyst

    I have a Creative Cloud Subscription. I have created a website in Muse and have published it in Business Catalyst but I would like to add Business Catalyst CMS functions like a Blog and a Sign-up form which I don't seem to be able to do with WebBasic

  • Create value condition formula on VFOM

    Hi people, I am with a little problem... I have to create value condition formula on VFOM, so I go on VFOM, then formulas, then value condition ... I go on botton of the list, set on edit mode, enter number 936 for the formula(witch doesnt exist)...