-2

AWS configuration issue and question. On Debian, during install we can set-up LVM configuration, which allows us to set up root / mounting point.

So normally for me it would look like this with Debian 9:

NAME                    FSTYPE      LABEL UUID                                   MOUNTPOINT
sda
├─sda1                  ext2              e9f69388-1854-45eb-8467-75211b2b22a9   /boot
├─sda2
└─sda5                  LVM2_member       mL4Ktn-n87F-2s1y-Jsiu-BFdQ-OVXg-CP6OAO
  ├─main--vg-root       ext4              a0781bd3-cc8f-49a6-bc90-f973e5296a2d   /
  └─main--vg-swap_1     swap              a5c9a5fe-14e3-499d-94cf-d6c2640d2c9a   [SWAP]

On AWS, unfortunately we cannot create boot mount point during installation, so my configuration looks like this:

NAME                  FSTYPE      LABEL UUID                                   MOUNTPOINT
nvme1n1               LVM2_member       i5HVTe-yn1Q-fhyK-kxMz-DpfO-SjE1-DgyMfi
├─main--vg-root       ext4              7e38e77e-603f-450f-a8b6-b7c199f021dd   /home
└─main--vg-swap_1     swap              c5ad16a3-2eb2-4d87-b22d-29a698f34a38
nvme0n1
└─nvme0n1p1           ext4              13ea901b-a08d-41a5-8e04-521c4415f9aa   /

My question is - can I move somehow /root mounting point to my main--vg-root ? Or maybe if not, it would be great to use two mounting points into one VG.

Best solution would be if I could use set-up nvme0n1p1 during LVM configuration, but I can't use partition that is in use, and unfortunately I cannot use any Live CD there to set it up?

peanek
  • 1

1 Answers1

0

I have made workaround with creating additional mounting point on my LVM volume and just create binds for 3 folders which were crucial for me.

So, following configuration in my question :

 NAME                  FSTYPE      LABEL UUID                                   MOUNTPOINT
nvme1n1               LVM2_member       i5HVTe-yn1Q-fhyK-kxMz-DpfO-SjE1-DgyMfi
├─main--vg-root       ext4              7e38e77e-603f-450f-a8b6-b7c199f021dd   /home
└─main--vg-swap_1     swap              c5ad16a3-2eb2-4d87-b22d-29a698f34a38
nvme0n1
└─nvme0n1p1           ext4              13ea901b-a08d-41a5-8e04-521c4415f9aa   /

Afterwards I've created data folder under /mnt/data/ afterwards /mnt/data/var, /mnt/data/home and /mnt/data/tmp

I've copy all data from original folders to newly created folders using cp -ax .

Afterwards edited /etc/fstab that changes in system will be applied on next reboot.

# Mounting point
/dev/main-vg/root                      /mnt/data      ext4    errors=remount-ro               0       1

# Binds
/mnt/data/home                         /home                   none    bind                            0       0
/mnt/data/var                          /var                    none    bind                            0       0
/mnt/data/tmp                          /tmp                    none    bind                            0       0

This workaround was created with help of another stackoverflow link Moving /var, /home to separate partition

peanek
  • 1