You are not logged in.

#1 2015-06-15 15:14:53

jat255
Member
From: Washington, DC
Registered: 2015-06-15
Posts: 18

Questions about adding disk to lvm with encryption

Hello,

When I installed Arch on my Dell E7240 last september, I had only one msata hard drive (128GB), but since I wanted full disk encryption, I installed arch using (I believe, since I took poor notes and followed a tutorial online) LVM on LUKS. I recently decommissioned an older laptop that had another msata drive (240GB), which I would like to be able to use in the Dell, since it has an extra msata port. It would be easiest to be able to just add the PV (new disk) to the existing root LV, but I have a feeling it's not that simple due to the encryption. If I'm reading the wiki correctly though, it looks like given my current setup, this might not be an option. The new drive is in there as sdb, but is currently not being used while I try to figure this all out.

I wanted to gather some opinions about what might be the best step going forward. I really would like to avoid having a separate partition (which would be easiest), as the main benefit of lvm (to me) is to be able to span volumes across disks. It looks like I would have to convert my current setup to LUKS on LVM to be able to do this, but I'm not sure what the best steps would be going forward. If it ends up having to be a full on reinstallation, I might also look into something like btrfs, since the snapshotting backup functionality looks really attractive. Basically, 128I was wondering if anyone had dealt with this kind of situation before and could offer some advice on what might be the easiest way to get my two drives to appear as one volume, with encryption (either full disk, or filesystem level).

Here are some details about the current setup:

○ lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                  8:0    0 119.2G  0 disk  
├─sda1               8:1    0   128M  0 part  /boot
└─sda2               8:2    0 119.1G  0 part  
  └─lvm            254:0    0 119.1G  0 crypt 
    ├─vol0-lv_swap 254:1    0     8G  0 lvm   [SWAP]
    └─vol0-lv_root 254:2    0 111.1G  0 lvm   /
sdb                  8:16   0 223.6G  0 disk  
○ sudo parted -l
Model: ATA SK hynix SH920 m (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name        Flags
 1      1049kB  135MB  134MB  fat16        EFI System  boot, esp
 2      135MB   128GB  128GB               Linux LVM   lvm


Model: ATA Crucial_CT240M50 (scsi)
Disk /dev/sdb: 240GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags
○ sudo fdisk -l
Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 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: gpt
Disk identifier: 5FC69071-6183-49E9-A8AE-7510F0EF0F09

Device      Start       End   Sectors   Size Type
/dev/sda1    2048    264191    262144   128M EFI System
/dev/sda2  264192 250069646 249805455 119.1G Linux LVM


Disk /dev/sdb: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xe45966fb


Disk /dev/mapper/lvm: 119.1 GiB, 127898295808 bytes, 249801359 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 /dev/mapper/vol0-lv_swap: 8 GiB, 8589934592 bytes, 16777216 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 /dev/mapper/vol0-lv_root: 111.1 GiB, 119306977280 bytes, 233021440 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
○ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/mapper/lvm
  VG Name               vol0
  PV Size               119.11 GiB / not usable 1.32 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              30493
  Free PE               0
  Allocated PE          30493
  PV UUID               xxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx
○ sudo vgdisplay
  --- Volume group ---
  VG Name               vol0
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               119.11 GiB
  PE Size               4.00 MiB
  Total PE              30493
  Alloc PE / Size       30493 / 119.11 GiB
  Free  PE / Size       0 / 0   
  VG UUID               xxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx
○ sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/vol0/lv_swap
  LV Name                lv_swap
  VG Name                vol0
  LV UUID                xxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx
  LV Write Access        read/write
  LV Creation host, time archiso, 2014-09-07 13:41:27 -0400
  LV Status              available
  # open                 2
  LV Size                8.00 GiB
  Current LE             2048
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1
   
  --- Logical volume ---
  LV Path                /dev/vol0/lv_root
  LV Name                lv_root
  VG Name                vol0
  LV UUID                xxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx
  LV Write Access        read/write
  LV Creation host, time archiso, 2014-09-07 13:41:58 -0400
  LV Status              available
  # open                 1
  LV Size                111.11 GiB
  Current LE             28445
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2
○ cat /etc/fstab
# 
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/mapper/vol0-lv_root
UUID=xxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx       /               ext4            rw,relatime,data=ordered        0 1

# /dev/sda1
UUID=xxxx-xxxx          /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 2

# /dev/mapper/vol0-lv_swap
UUID=xxxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxxx       none            swap            defaults        0 0

Last edited by jat255 (2015-06-15 15:15:08)

Offline

#2 2015-06-24 02:39:24

jat255
Member
From: Washington, DC
Registered: 2015-06-15
Posts: 18

Re: Questions about adding disk to lvm with encryption

Bump?

Offline

Board footer

Powered by FluxBB