Mounting an LVM on Luks Partition [SOLVED]

Hello Arch Linux Community:
This likely sounds like a very stupid question, but I have honestly hit a wall and need some advice. To make a long story short I was messing around in some configuration files and forgot to undo a change that I made before rebooting, which has rendered my system mostly inoperable. (I mistakenly changed the address for Bash in /etc/shells, so I can't log in as either my user or root). Now ordinarily this would be a very simple fix, but for whatever reason it is proving to be far more difficult that I anticipated. My root partition is stored as Logical Volume on a Physical Volume on /dev/sda3 and the entire Volume Group (containing my root, home, swap and var partitions) is locked up with Luks.
I booted my computer to an Arch live CD and attempted to mount the root filesystem, though wasn't exactly sure how to go about doing it (I tried several methods). First I tried just opening the root logical volume and mounting that.
# cryptsetup luksOpen /dev/sda3 rootvol
# mount /dev/mapper/rootvol /mnt
This resulted in the system alerting me that the device I was trying to mount was an LVM2 member and that the system could not do it. So next I tried opening the entire Volume Group.
# cryptsetup luksOpen /dev/sda3 VolGroup00
# mount /dev/mapper/VolGroup00 /mnt
Which, as I expected did not work. However, when I tried to mount the root volume again (having opened the entire Volume Group)
# mount /dev/mapper/VolGroup00-rootvol /mnt
and
# mount /dev/VolGroup00/rootvol /mnt
the system alerted me that the device I was trying to mount did not exist, which is odd considering that running
# lvdisplay /dev/VolGroup00
showed all of my logical volumes to exist at the locations /dev/VolGroup00/foo.
I could really use some guidance here. I know that I'm probably missing something very stupid and obvious, but I cannot for the life of me see it. Thank you for your time.
Douglas Bahr Rumbaugh, Jr.
Last edited by douglasr (2013-06-23 23:14:56)

After the luksOpen I believe you need
vgchange -a y

Similar Messages

  • [SOLVED] Initramfs fails to properly mount luks partition

    Hello All,
    As I foreshadowed in my intro, I'm having trouble getting encrypted Archlinux to work on my Acer Aspire 5750. I've previously had encrypted Debian Netinst and encrypted Aptosid working on this device. The arch iso I'm using is 2011.08.19-core-i686.
    https://bbs.archlinux.org/viewtopic.php?id=124415 appears similar and Tallahassee offers a workaround, but it doesn't work for me (unless I'm doing something wrong?)
    I suspect there is a bug in the init scripts used by the initramfs. I would like to first of all determine whether I really should file a bug report (and if so where), and secondly whether we can find a workaround to get things up and running in the meantime.
    Now for the meaty bits.
    Old grub doesn't appear to support lvm or luks, so I first of all prepare for grub 2 by installing the gptfdisk package into the iso environment. I use gdisk to set up a 1 or 2 mb bios boot partition at the start of /dev/sda, followed by a 256mb partition (/dev/sda2) for /boot, with the rest of the drive given to the partition intended for the encrypted root partition (/dev/sda3).
    I use cfdisk to toggle the partition type for /dev/sda3 to 8e (Linux LVM).
    Run the following commands, with credits to Aptosid: Installing to a Cryptroot:
    pvcreate /dev/sda3
    vgcreate vg /dev/sda3
    lvcreate -n crypt --extents 100%FREE vg
    cryptsetup --verify-passphrase -c aes-xts-plain:sha512 luksFormat /dev/mapper/vg-crypt
    cryptsetup luksOpen /dev/mapper/vg-crypt cryptroot
    pvcreate /dev/mapper/cryptroot
    vgcreate cryptvg /dev/mapper/cryptroot
    lvcreate -n swap --size 2g cryptvg
    lvcreate -n root --extents 25%FREE cryptvg
    lvcreate -n home --extents 100%FREE cryptvg
    /arch/setup
    Go through the arch setup as normal. At the bit where you configure hard-drives, you'll find all your encrypted partitions ready waiting to be labelled and formatted. Stop after installing packages.
    After installing packages, press CTL-ALT-F2 and log in. Edit /mnt/etc/rc.conf and /mnt/etc/mkinitcpio.conf. CTL-ALT-F1 and reinstall packages. Proceed with the configure step.
    Don't install a boot loader; just quit after configuring everything.
    Follow the steps here: Grub 2 During Archlinux Installation.
    The automatically generated grub.cfg doesn't include things necessary to lvm and luks. Before running grub_bios-install, I edit the grub.cfg to insmod lvm and flag the kernel with cryptdevice=/dev/mapper/vg-crypt:cryptvg-root and rootfstype=ext4 (because that is the encrypted root's filesystem).
    At this point, I would expect the system to be bootable, so reboot.
    Grub2 loads up. I can verify the changes I made to grub.cfg by pressing `e'. So boot and see the messages,
    Loading Linux linux ...
    Loading initial ramdisk ...
    A password is required to access the cryptvg-root volume:
    Enter passphrase for /dev/mapper/vg-crypt:
    So far so good. I enter my passphrase. The following messages ensue:
    vgscan: unrecognized option '--sysinit'
    Error during parsing of command line.
    device-mapper: create ioctl failed: Device or resource busy
    mount: mounting /dev/mapper/cryptvg-root on /new_root failed: Device or resource busy
    ERROR: Failed to mount he real root device.
    Bailing out, you are on your own. Good luck.
    So I get dumped into the ramfs. That ain't much fun.
    Does anyone have some ideas on things to try next? Should I file a bug report?
    Last edited by /dev/zero (2011-10-22 00:28:52)

    Not sure what you mean by difficult and buggy to work with... at this low level, if a VM is having issues replicating this sort if thing, it's not a very useful VM. Find one that doesn't suck. I tend to use KVM because it's terminal friendly via emulation of a serial console.
    Anyways, I can reproduce your issue and fix it. There's 2 things you'll need to change:
    1) You're naming your unlocked cryptdevice the same thing as your root. That's creating a clash with the name you've given your root logical volume. Since the name isn't really important, just change your cryptdevice declare to "cryptdevice=/dev/mapper/vg-crypt:root"
    2) Since you're doing the xzibit thing and nesting lvm inside of the crypt device (i still think its really bizzare to do this, but it looks like mkinitcpio supports it anyways), you'll need to add the lvm2 hook a second time to HOOKS in /etc/mkinitcpio.conf after the encrypt hook.
    Last edited by falconindy (2011-10-22 00:19:10)

  • [Solved] Problem booting root in LVM, which spans two LUKS partitions

    Hello,
    I recently switched to Arch from OpenSuse, and I'm having a bit of trouble getting my encrypted disks to boot properly. I have two disks, the first is a 4 TB drive set up like this:
    MBR partition table
    Partition 1 - Windows 7, 200GB
    Partition 2 - Linux boot, 200MB
    Partition 3 - Luks partition, 1.7TB
    Partition 4 - Luks partition, 1.7TB
    Within partition 3 and 4 is an LVM volume which spans the two partitions. The reason for that is just that I can't have a 3.4TB partition on an MBR formatted drive (as I understand it). I have the root volume and swap, etc within this LVM. The second hard drive is simply a data drive, also encrypted. My problem is that I don't know how to tell the system to open both of these encrypted partitions at boot, in order to boot the root volume. This worked fine under OpenSuse and I only needed to enter the Luks password once (it is the same for both partitions).
    As it is right now, my boot parameters in /etc/default/grub look like this:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset cryptdevice=/dev/sda3:sda3_crypt root=/dev/mapper/vg_arch-root"
    Currently the system boots, asks for the password to /dev/sda3, hangs for roughly 20 seconds and then kicks me into a root prompt. I can manually open /dev/sda4 at this point using cryptsetup and the system will continue booting normally... but I would like to have it set up properly, so I don't need to do that. Considering OpenSuse does this out of the box I figured it should be possible under Arch. Any help would be appreciated.
    Thanks
    Last edited by keitolainen (2015-06-09 21:56:08)

    As a quick update in case anyone is reading this, I cleaned up the script a bit and hopefully made it something closer to a "proper" fix.
    Rather than editing /usr/lib/initcpio/hooks/encrypt directly, I did the following:
    cp /usr/lib/initcpio/hooks/encrypt /etc/initcpio/hooks/
    then changed the following section of /etc/initcpio/hooks/encrypt from:
    # Ask for a passphrase
    if [ ${dopassphrase} -gt 0 ]; then
    echo ""
    echo "A password is required to access the ${cryptname} volume:"
    #loop until we get a real password
    while ! eval cryptsetup open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; do
    sleep 2;
    done
    fi
    to:
    # Ask for a passphrase
    if [ ${dopassphrase} -gt 0 ]; then
    echo ""
    while true ; do
    echo -n "A password is required to access the ${cryptname} volume: "
    read -sr password
    echo $password | cryptsetup open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}
    if [ $? = 0 ] ; then
    break
    fi
    done
    echo $password | cryptsetup open --type luks /dev/sda4 sda4_crypt
    echo ""
    fi
    then edited /etc/mkinitcpio.conf and changed:
    FILES=""
    to:
    FILES="/etc/initcpio/hooks/encrypt"
    and ran
    mkinitcpio
    This is working well for me and I think it's a little cleaner than the solution I posted earlier. Sorry for the awkward bash, if anyone has a more elegant solution please let me know.

  • [Solved] How to resize an encrypted luks partition?

    Edit: This worked: http://www.enigmacurry.com/2007/04/28/r … ilesystem/
    I have some empty space on my harddrive, and wish to fill it up, with my existing partition.
    This is my harddrive setup in gparted:
    And fdisk respectively:
    [ricky@archlinux ~]$ sudo fdisk /dev/sda -l
    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x58bd1192
    Device Boot Start End Blocks Id System
    /dev/sda1 * 63 289169 144553+ 83 Linux
    /dev/sda2 289170 195607439 97659135 83 Linux
    /dev/sda2 (the crypted luks partition) contains an lvm group.
    I am trying to enlarge the luks partition, to fill all of the empty space, soi can give some more space to the lvm's inside the encrypted partition.
    I did come across an interesting page here: http://www.enigmacurry.com/2007/04/28/r … ilesystem/
    Is this the correct approach, by deleting the WHOLE partition (not the data), and then simply creating a new partition, with the same start-sector, and the higher end-sector?
    Will that allow me to then resize my lvm's inside of the luks partition?
    I am sorry if this is confusing.
    Last edited by xdemo (2011-03-18 07:53:35)

    jakobm wrote:Please be sure to use the bbs search: Defragment a NTFS partition from LINUX
    That thread has absolutely no information other than a list of motivations to use Windows to defrag it... and a link to a buggy Python defragger.
    Here's the only bulletproof way to defrag NTFS under Linux:
    Make a new partition of the same size (or bigger), and format it to NTFS and mount it at /defragged
    Mount your fragged partition at /fragged
    rsync -av /fragged /defragged
    Wha-la. /defragged is now your fragged partition, defragged. Reformat /fragged and rsync it back if you really must.
    Drives get fragmented if you do multiple copies at the same time, so don't do anything else on the drive while it's syninc.
    Last edited by dagelf (2014-08-28 07:21:54)

  • System encryption :: Luks on lvm or Lvm on Luks?

    Hello,
    I was reading up about lvm and luks and decided I want to encrypt my system. Until now I have been using truecrypt to encrypt a data partition which get mounted during boot. I recently bought myself a netbook and since then I've been pondering how to make the most use of HD space and keeping it secure should it get stolen.
    I have 3 Harddrives in my tower. One of the HDs is my backup drive. The other two are for OSs. What I would like to do is
    1) Create an encrypted volume group on HD 1 (has about 650 Gb).
    2) Create 2 LVs for /root /home on HD1
    3) Rsync /root and /home to the LVs  HD2 -> HD1
    4)  HD2 secure erase
    5) create VG on HD2 and add it to VG on HD1
    *** My Question ***
    While reading up on lvm and luks I came upon this article and I'm not quite sure which one is better suited for my situation. I don't know how easy it is to grow/add to an encrypted vg or lg.
    There are two ways of setting up an encrypted disk using LVM:
    1. Create the LVM and encrypt every volume separately
    2. Set up LVM on top of an encrypted partition
    source :: http://www.pindarsign.de/webblog/?p=767
    Update : Using badblocks on /dev/sda4 didn't work as intended. It completely wiped /dev/sda.  One way of going Windows free.
    Luckily enough windows 7 was still able to boot without a partition table (scratches head), so I was able to copy some saved games and the downloads folder.
    Last edited by whitethorn (2011-09-19 15:12:12)

    Dieter@be wrote:
    AFAIK you cannot resize luks/dm_crypt devices, so you lose a lot of the flexibility if you put luks on top. of lvm.
    personally i do full disk encryption with luks/dm_crypt, then lvm on top of that.
    btw the arch installer supports both scenarios out of the box.
    Sounds like what I'm doing right now. I encrypted my first HD then added lvm on top of that. It took a little while to get a seperate boot working and chroot to get all the files setup how I want. At the moment I'm randomizing a 2 Tb harddrive 10 hours 85%. Once it finishes encrypt the drive and add lvm on top. I'm not quite sure if I can grow my /home with the space from the 2nd drive and how to decrypt it during boot

  • Best way to securely backup LVM on LUKS encrypted system

    I'm upgrading harddisks and would like to backup my system to external storage and restore it on the new disk
    This is the high level plan:
    1. use ecryptfs to create an encrypted directory on a mounted external stroage device
    2. mount ecryptfs directory
    3. use rsync to make a backup into the ecryptfs directory
    4. swap harddisks
    5. use an arch live usb to encrypt and partition new disk (LVM on LUKS)
    6. mount external storage and mount encrypted ecryptfs on the storage
    7. restore system with rsync
    Is this the way to do it?
    After reading a little on ecryptfs, it seems like the passphrase and keys I create work only for the current kernel using ecryptfs (adds to the kernel key ring). So my understanding is that if I try to decrypt and mount the ecryptfs using a live arch usb, I won't be able to.
    Any clarification of the process would be of great help! Thank you

    clfarron4 wrote:Any particular reason you're planning to use eCryptfs for the backup and LUKS for the actual system when you could use LUKS for both?
    No particular reason for ecryptfs. I believe my two options are ecryptfs and encfs as described in the disk encryption comparison table: https://wiki.archlinux.org/index.php/Di … ison_table
    clfarron4 wrote:
    trillian wrote:After reading a little on ecryptfs, it seems like the passphrase and keys I create work only for the current kernel using ecryptfs (adds to the kernel key ring). So my understanding is that if I try to decrypt and mount the ecryptfs using a live arch usb, I won't be able to.
    I'm not sure whether this is how it works. Could you show us the documentation which led you to this conclusion please?
    I'm also not very familiar with keyrings and how the kernel manages it, or whether it's possible to do what I want with ecryptfs.
    http://manpages.ubuntu.com/manpages/uto … ase.1.html

  • LVM on LUKS on LVM

    Does anyone know if, on a system with LVM on LUKS on LVM, a logical volume created inside a LUKS container can be added to the same volume group that the LUKS container is in? Even if this is possible, is it this just a bad idea from a security perspective? Should the outer LVM and inner LVM each have their own physical devices, volume groups, and logical volumes?

    sda
    └─sda1
      └─Storage 254:0    0 XG  0 lvm
        ├─Storage-lrootvol                        254:1    0    XG  0 lvm   /
        └─luks 254:0    0 XG  0 crypt
          ├─Storage-lvarvol                         254:2    0    XG  0 lvm   /var
          ├─Storage-lhomevol                        254:3    0   XG  0 lvm   /home
          ├─Storage-ltmpvol                        254:4    0   XG  0 lvm   /tmp
          └─Storage-lswapvol                        254:5    0   XG  0 lvm   swap
    Yes, that's what I was thinking, except that it's all on sda2 because sda1 is my EFI System partion.
    Why don't you just encrypt the root partition as well? Any reason why that wouldn't work for you?
    This is on a laptop, so I was trying to avoid the performance/battery life penalty of encrypting the root partition.

  • 2 question concerning LVM over LUKS

    I succesfully configured LVM over LUKS, but have 2 parts that are not 100% clear to me
    My setup is now
    /dev/vda1       /boot
    /dev/vda2       LVM2 with volumegroup name lvm holding three logical volumes: lvm-root, lvm-home, lvm-swap
    The following I am wondering if someone would like to clarify to me
    1. For booting I added cryptdevice to my kernel with the following parameter settings
           kernel /vmlinuz-linux cryptdevice=/dev/vda2:encrypted root=/dev/mapper/lvm-root ro
        It doesn't seems to matter what name I use in the red part of cryptdevice.
        So why do I need to put a name in this red part ?? Does it matter at all what name I use here ??
    2. I did not fill in anyhting in /etc/crypttab and all seems to be working without issues.
        I could have entered something like "encrypted             /dev/vda2           none           luks" in it....
        What good would it do me to enter anything in crypttab ?? When would I really need this to be filled in ??
    Hoping someone would mind to explains this to me .... thx

    I just started playing with encryption so take what I say with a block of salt.
    The name you give is what will show up in /dev/mapper, ie /dev/mapper/encrypted in this case.  Since you're using lvm I think you could change the name every boot if you wanted.  OTOH, if you formatted the partition directly, you could use the /dev/mapper/encrypted in fstab for example.
    On the subject of crypttab I can't help you, except to say that in my experiments with encryption I've never touched it.

  • Hello. I have a problem with OEL 6.5 and ocfs2. When I mount ocfs2 with mount -a command all ocfs2 partitions mount and work, but when I reboot no ocfs2 partitions auto mount. No error messages in log. I use DAS FC and iSCSI FC.

    Hello.
    I have a problem with OEL 6.5 and ocfs2.
    When I mount ocfs2 with mount -a command all ocfs2 partitions mount and work, but when I reboot no ocfs2 partitions auto mount. No error messages in log. I use DAS FC and iSCSI FC.
    fstab:
    UUID=32130a0b-2e15-4067-9e65-62b7b3e53c72 /some/4 ocfs2 _netdev,defaults 0 0
    #UUID=af522894-c51e-45d6-bce8-c0206322d7ab /some/9 ocfs2 _netdev,defaults 0 0
    UUID=1126b3d2-09aa-4be0-8826-0b2a590ab995 /some/3 ocfs2 _netdev,defaults 0 0
    #UUID=9ea9113d-edcf-47ca-9c64-c0d4e18149c1 /some/8 ocfs2 _netdev,defaults 0 0
    UUID=a368f830-0808-4832-b294-d2d1bf909813 /some/5 ocfs2 _netdev,defaults 0 0
    UUID=ee816860-5a95-493c-8559-9d528e557a6d /some/6 ocfs2 _netdev,defaults 0 0
    UUID=3f87634f-7dbf-46ba-a84c-e8606b40acfe /some/7 ocfs2 _netdev,defaults 0 0
    UUID=5def16d7-1f58-4691-9d46-f3fa72b74890 /some/1 ocfs2 _netdev,defaults 0 0
    UUID=0e682b5a-8d75-40d1-8983-fa39dd5a0e54 /some/2 ocfs2 _netdev,defaults 0 0

    What is the output of:
    # chkconfig --list o2cb
    # chkconfig --list ocfs2
    # cat /etc/ocfs2/cluster.conf

  • Bootcamp Mounts Window's System Reserved Partition

    Bootcamp has decided to mount Window's System Reserved partition instead of the actual Windows partition. It was working fine up until this week when I decided to plug in an external hard drive. After I plugged it in and restarted into OS X, the problem started. The real Windows partition does not appear in Disk Utility. I have tried disabling NTFS-3G and booting without the external hard drive but nothing seems to work. Anyone have any ideas?

    What do you call Boot Camp anyway?
    The 100MB partition is where Windows boots, if present.
    And Disk Utility can mess up Windows 7 and NTFS volumes.
    Maybe all the problems are from using NTFS-3G of course.
    A number of people, myself incl. do not see Windows in the Apple System Prefs control panel (startup disk).
    Windows and Mac OS X do show in Windows 7 control panel Boot Camp.
    People misuse the name/term "Boot Camp" (as does Apple) as if it was or does things it does not.

  • Can't install grub2 with presence of ufs2 partitions [Solved]

    I'm trying FreeBSD in lieu of OpenBSD.  OpenBSD works fine on MBR, but FreeBSD is picky and generally wants GPT.  Was able to get FreeBSD working as long as it's protective MBR is used.  Then when I want back into Arch, I have to put syslinux gptmbr.bin back into the MBR, but FreeBSD doesn't like the dd method.  FreeBSD protects the MBR from being overwritten.  This is GPT/BIOS not GPT/UEFI.  The GPT conversion went without a hitch just fine.  I can't even emulate Arch inside FreeBSD because of the MBR bootcode.  I can however emulate FreeBSD inside Arch and even mount read-only the ufs2 partition with the following sequence:
    mount -t ufs -o ufstype=ufs2 -o ro /dev/sdaxx /mnt
    When I do grub-install /dev/sda from Arch I get the following message:
    Installing for i386-pc platform.
    grub-install: error: hostdisk//dev/sda appears to contain a ufs2 filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).
    Then when I do grub-install /dev/sda --skip-fs-probe I get:
    Installing for i386-pc platform.
    grub-install: warning: Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet..
    grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
    grub-install: error: will not proceed with blocklists.
    Booting from freebsd-boot reboots the computer and trying to boot from freebsd-ufs just sits there.  I also think it sort of hard on the MBR to rewrite it each time I need to switch back and forth.  I am currently using syslinux which is fine for linux (linux didn't even notice the difference between MBR and GPT), but nothing I put in syslinux.cfg will boot FreeBSD.  FreeBSD doesn't like my wifi card (b43), but OpenBSD uses it until performance degrades to nothing. 
    Adding a line to my grub.cfg for FreeBSD would be like this:
    menuentry "FreeBSD" {
    set root="(hd0,msdos1,bsd1)"
    kfreebsd /boot/loader
    I don't have that line in there yet, but I doubt it would take it.
    Even setting aside a BIOS boot partition (ef02) or extlinux doesn't even get noticed by grub.
    Last edited by nomorewindows (2014-01-21 18:31:45)

    I dd'd FreeBSD's protective MBR, and saved into a file.  I ran qemu -kernel memdisk -initrd freebsd.mbr /dev/sda and it booted.  So then how do I get it into syslinux?  I already had a chainload from OpenBSD, so I modified it slightly to use the FreeBSD's MBR from the file.
    LABEL FreeBSD
    MENU LABEL FreeBSD
    COM32 chain.c32
    APPEND file=../freebsd.mbr
    Marking this as a new workaround to GPT/BIOS/FreeBSD with syslinux.

  • Resizing luks partition "in front"

    Hello
    I have currently the following partitioning scheme:
    .-(~)----------------------------------------------------------------------------------------------------(root@tirion)-
    `--# fdisk -l /dev/sda
    Disk /dev/sda: 107.1 GiB, 115033153536 bytes, 224674128 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x4488c4dc
    Device Boot Start End Sectors Size Id Type
    /dev/sda1 * 63 192779 192717 94.1M 83 Linux
    /dev/sda2 192780 224674127 224481348 107G 83 Linux
    sda1 is a normal ext4 partition, sda2 LUKS with ext4
    I found out, how I can grow a LUKS partition on the "end", but how can I get rid of sda1 and resize the luks partition to take all of the space?

    Growing, or resizing in general, only happens on the end. So the way to do that would be to delete sda1 & sda2 (in the partition table that is) and create a new partition sda1 over the entire disk. Then you'd need to move the data from the old sda2 to be located where they outta be, so say for example your new partition would be like e.g.
    Device Boot Start End Sectors Size Id Type
    /dev/sda1 2048 224674127 224672080 107G 83 Linux
    That would mean sda2 used to start at 192780*512=98703360 and the new one would now start at 2048*512=1048576 -- So I guess you could move data e.g. with dd:
    dd bs=4M if=/dev/sda skip=98703360 iflag=skip_bytes of=/dev/sda seek=1048576 oflag=seek_bytes
    It should put the data of the old sda2 right in the new sda1 location, so you can use it as expected. Then you can then grow your filesystem as usual (on the end) to take all the space/partition.
    Assuming sda2 has a LUKS header, a simply way to make sure your at the right place would be:
    dd if=/dev/sda bs=4 count=1 skip=98703360 iflag=skip_bytes
    If it's right, it should read/show "LUKS"
    Of course you should have a backup of your data before doing any of that. (Also some tools like maybe gparted or something might be able to do the whole thing "automatically" for you, I don't know.)

  • Terminal Command to Re-Mount an Unmounted Local Disk Partition?

    Hello,
    Does anyone know a terminal command (or applescript command) to re-mount an unmounted local disk partition? I know it can be done using the DiskUtility, but I would like to do it from the Terminal without launching another program.
    Using Tiger 10.4.5 on a G5
    Thanks,
    Tom
    G5 2.3 MHz dual core   Mac OS X (10.4.5)  

    Hi Tom,
       AppleScript will execute anything that you can exectute from the command line that isn't interactive but it won't execute it in the same way. By that I mean that the environment will be more vanilla. In this case the problem is that the path is rather basic. All you have to do is to use an absolute path to the script and it should work. Apple has a pretty good reference for the mechanism, Technical Note TN2065: do shell script in AppleScript.
       Is wakeonlan basically the same thing as waking upon receipt of a "magic packet"? I think you can easily make Mac OS X do that by itself. Just open System Preferences and the "Options" tab of the "Energy Saver" pane. Check the checkbox beside "Wake for Ethernet network administrator access".
    Gary
    ~~~~
       I gave my love an Apple, that had no core;
       I gave my love a building, that had no floor;
       I wrote my love a program, that had no end;
       I gave my love an upgrade, with no cryin'.
       How can there be an Apple, that has no core?
       How can there be a building, that has no floor?
       How can there be a program, that has no end?
       How can there be an upgrade, with no cryin'?
       An Apple's MOS memory don't use no core!
       A building that's perfect, it has no flaw!
       A program with GOTOs, it has no end!
       I lied about the upgrade, with no cryin'!

  • LVM on LUKS split across drives

    I'm installing LVM on LUKS, as follows:
    /dev/sda1: boot
    /dev/sda2: first LUKS device
    /dev/sdb1: second LUKS device
    /dev/sda2 and /dev/sdb1 are in a volume group, which is then split into logical volumes.
    /dev/sda2 and /dev/sdb1 have the same password.
    How can I only be prompted once for this password at boot?

    Strike0 has told me in the past that this is actually supported.  Just use the LVM2 hook twice, once before and once after the encrypt hook.  There is also the cryptsetup-multi package, but it is partially broken. In these forums somewhere there are instructions from falconindy on using the hook (maybe the install) file from the multi package in the current cryptsetup package.  but you are going to have to seach for that yourself.

  • [Solved] Enlarge logical Volume (LVM on Luks)

    I moved my whole system to a new SSD which is bigger than the old one, now I need to enlarge the root partition.
    sda3 is my LUKS encrypted partition.
    lsblk:
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 74,5G 0 disk
    ├─sda1 8:1 0 2M 0 part
    ├─sda2 8:2 0 200M 0 part /boot
    └─sda3 8:3 0 29,6G 0 part
    └─MyStorage 254:0 0 29,6G 0 crypt
    ├─MyStorage-swapvol 254:1 0 1G 0 lvm [SWAP]
    └─MyStorage-rootvol 254:2 0 28,6G 0 lvm /
    How can I resize sda3, MyStorage and Mystorage-rootvol without loosing data?
    I found a post in the ubuntu-Wiki, but didn't quite understand Step 3.
    Thanks in advance
    Last edited by hasdf (2014-11-23 17:17:38)

    frostschutz wrote:Is there free space on the disk to make that partition larger?
    If I got you right, there is free space after the partition:
    Modell: ATA INTEL SSDSA2M080 (scsi)
    Festplatte /dev/sda: 156301488s
    Sektorgröße (logisch/physisch): 512B/512B
    Partitionstabelle: gpt
    Disk-Flags:
    Nummer Anfang Ende Größe Dateisystem Name Flags
    34s 2047s 2014s Freier Platz
    1 2048s 6143s 4096s
    2 6144s 415743s 409600s ext2
    3 415744s 62533262s 62117519s
    62533263s 156301454s 93768192s Freier Platz
    Thank you for your help! I'll try it and post the result here.
    EDIT: I coudn't enlarge the partition like frostschulz said. And since I had to delete the partition in question, I just deleted everything and reinstalled archlinux with a full system backup.
    Last edited by hasdf (2014-11-23 17:15:07)

Maybe you are looking for

  • AP Issue with Tax Jurisdiction

    Hello AP Guru's- I have a situation where were are adding line items to an invoice with a PO.  The tax jurisdiction code is correct but when we add a G/L, it is pulling the wrong tax jurisdiction code?  Where is SAP pulling this tax jurisdiction code

  • How do I find the directory where my bookmarks are kept using windows explorer?

    Neither firefox nor internet explorer work anymore on my administrator account, but internet explorer works on my guest account. Perhaps a virus caused this. But windows explorer works fine. Computer is so fouled up I want to just buy a new one, bett

  • ITunes Crashes when I plug in my iPhone - fault module: QuickTime.qts

    About a week ago iTunes started crashing as soon as I plugged in my iPhone 3Gs To the best of my recollection I had not changed anything. iPhone is running OS 4.1 iTunes version 10.0.1.22 on Vista Here is the crash report: Problem signature Problem E

  • Sent Mail STILL not showing anything in the attachments column

    I was hoping this would be fixed with the 10.7.1 update but it hasn't happened. All I can see is the paper clip icon at the top of the column, but NO indication of any attachments alongside individual messages. So how am I supposed to know that my at

  • How to install Windows 2000 Server in x61

    I got a new x61 model:7673-B93, and need to install Windows 2000 server in it, but failed. Can anyone tell me if I can do this? Thanks