Answer the question
In order to leave comments, you need to log in
How to migrate a running Debian 11 OS to RAID1 with existing LVM partitioning?
Good afternoon!
We rented a server at a remote site with 4 HDDs. Of the possible installation options, only RAID0, RAID1, RAID10 and LVM were offered.
We decided that the following scheme for distributing the HDD volume would be the most suitable:
SWAP - RAID1 - 5Gb
/ - RAID1 - 24Gb
/home - RAID5 - all the remaining space
According to the instructions from the "internets" ( Habr ), it was possible to understand that everything is realizable.
During installation, the LVM installation mode was selected.
We got the following partition scheme:
~# lsblk /dev/sda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 977M 0 part /boot
└─sda3 8:3 0 930.6G 0 part
├─vg0-swap_1 254:0 0 4.8G 0 lvm [SWAP]
├─vg0-root 254:1 0 22.9G 0 lvm /
└─vg0-home 254:2 0 902.9G 0 lvm /home
~# fdisk -l /dev/sda
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM003-1ER1
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: gpt
Disk identifier: 8B063280-E7F8-4E70-964A-C5C44435B799
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 2004991 2000896 977M Linux filesystem
/dev/sda3 2004992 1953523711 1951518720 930.6G Linux LVM
~# sfdisk -d /dev/sda | sfdisk -f /dev/sdb
Checking that no-one is using this disk right now ... OK
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM003-1ER1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new GPT disklabel (GUID: 8B063280-E7F8-4E70-964A-C5C44435B799).
/dev/sdb1: Created a new partition 1 of type 'BIOS boot' and of size 1 MiB.
/dev/sdb2: Created a new partition 2 of type 'Linux filesystem' and of size 977 MiB.
/dev/sdb3: Created a new partition 3 of type 'Linux LVM' and of size 930.6 GiB.
Partition #3 contains a LVM2_member signature.
/dev/sdb4: Done.
New situation:
Disklabel type: gpt
Disk identifier: 8B063280-E7F8-4E70-964A-C5C44435B799
Device Start End Sectors Size Type
/dev/sdb1 2048 4095 2048 1M BIOS boot
/dev/sdb2 4096 2004991 2000896 977M Linux filesystem
/dev/sdb3 2004992 1953523711 1951518720 930.6G Linux LVM
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
~# fdisk -l
Disk /dev/sdd: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM003-1ER1
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: gpt
Disk identifier: 8B063280-E7F8-4E70-964A-C5C44435B799
Device Start End Sectors Size Type
/dev/sdd1 2048 4095 2048 1M BIOS boot
/dev/sdd2 4096 2004991 2000896 977M Linux filesystem
/dev/sdd3 2004992 1953523711 1951518720 930.6G Linux LVM
Disk /dev/sdc: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM003-1ER1
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: gpt
Disk identifier: 8B063280-E7F8-4E70-964A-C5C44435B799
Device Start End Sectors Size Type
/dev/sdc1 2048 4095 2048 1M BIOS boot
/dev/sdc2 4096 2004991 2000896 977M Linux filesystem
/dev/sdc3 2004992 1953523711 1951518720 930.6G Linux LVM
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM003-1ER1
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: gpt
Disk identifier: 8B063280-E7F8-4E70-964A-C5C44435B799
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 2004991 2000896 977M Linux filesystem
/dev/sda3 2004992 1953523711 1951518720 930.6G Linux LVM
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM003-1ER1
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: gpt
Disk identifier: 8B063280-E7F8-4E70-964A-C5C44435B799
Device Start End Sectors Size Type
/dev/sdb1 2048 4095 2048 1M BIOS boot
/dev/sdb2 4096 2004991 2000896 977M Linux filesystem
/dev/sdb3 2004992 1953523711 1951518720 930.6G Linux LVM
Disk /dev/mapper/vg0-swap_1: 4.77 GiB, 5117050880 bytes, 9994240 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
Disk /dev/mapper/vg0-root: 22.89 GiB, 24574427136 bytes, 47996928 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
Disk /dev/mapper/vg0-home: 902.9 GiB, 969484009472 bytes, 1893523456 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
~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 977M 0 part /boot
└─sda3 8:3 0 930.6G 0 part
├─vg0-swap_1 254:0 0 4.8G 0 lvm [SWAP]
├─vg0-root 254:1 0 22.9G 0 lvm /
└─vg0-home 254:2 0 902.9G 0 lvm /home
sdb 8:16 0 931.5G 0 disk
├─sdb1 8:17 0 1M 0 part
├─sdb2 8:18 0 977M 0 part
└─sdb3 8:19 0 930.6G 0 part
sdc 8:32 0 931.5G 0 disk
├─sdc1 8:33 0 1M 0 part
├─sdc2 8:34 0 977M 0 part
└─sdc3 8:35 0 930.6G 0 part
sdd 8:48 0 931.5G 0 disk
├─sdd1 8:49 0 1M 0 part
├─sdd2 8:50 0 977M 0 part
└─sdd3 8:51 0 930.6G 0 part
Answer the question
In order to leave comments, you need to log in
We decided that the following HDD volume distribution scheme would be the most suitable:
SWAP - RAID1 - 5Gb
/ - RAID1 - 24Gb
/home - RAID5 - all remaining space
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question