Vorbereiten
Starten Sie ihren dedizieren Server über das Webinterface in das Notfallsystem (Rescue).
Voraussetzungen
2 Festplatten
Notfallsystem (Rescue)
Partitionieren
Erstellen Sie nun die Partitionen auf der ersten Festplatte und kopieren Sie diese anschliessend auf die zweite Festplatte:
parted --script /dev/sda mklabel gpt mkpart primary 1MB 3MB name 1 grub set 1 bios_grub on mkpart primary 3MB 503MB name 2 boot set 2 boot on mkpart primary 503MB 100% name 3 system
sgdisk -R=/dev/sdb /dev/sda
The operation has completed successfully.
Nun können Sie das Software RAID erstellen:
mdadm --create /dev/md0 --level 0 --raid-devices=2 /dev/sda2 /dev/sdb2 --metadata=0.90
mdadm --create /dev/md1 --level 1 --raid-devices=2 /dev/sda3 /dev/sdb3
mdadm: array /dev/md0 started.
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md1 started.
pvcreate /dev/md1 -ffy
vgcreate lvm /dev/md1 -ffy
lvcreate -v -y -d -L 500MiB -n swap lvm
lvcreate -y -l 100%FREE -n root lvm -v
Physical volume /dev/md1 successfully created.
Volume group lvm successfully created
Archiving volume group lvm metadata (seqno 1).
Creating logical volume swap
Creating volume group backup /etc/lvm/backup/lvm (seqno 2).
Activating logical volume lvm/swap.
activation/volume_list configuration setting not defined: Checking only host tags for lvm/swap.
Creating lvm-swap
Loading table for lvm-swap (253:0).
Resuming lvm-swap (253:0).
Wiping known signatures on logical volume lvm/swap
Initializing 4.00 KiB of logical volume lvm/swap with value 0.
Logical volume swap created.
Converted 100% of FREE (476654) extents into 476654 (with mimages 1 and stripes 1 for segtype striped).
Archiving volume group lvm metadata (seqno 2).
Creating logical volume root
Creating volume group backup /etc/lvm/backup/lvm (seqno 3).
Activating logical volume lvm/root.
activation/volume_list configuration setting not defined: Checking only host tags for lvm/root.
Creating lvm-root
Loading table for lvm-root (253:1).
Resuming lvm-root (253:1).
Wiping known signatures on logical volume lvm/root
Initializing 4.00 KiB of logical volume lvm/root with value 0.
Logical volume root created.
Formatieren Sie nun die Partitionen mit den einsprechenden Dateisystemen:
mkfs.ext4 -F -L boot /dev/md0
mkswap /dev/mapper/lvm-swap
swapon /dev/mapper/lvm-swap
mkfs.ext4 -F -L root /dev/mapper/lvm-root
mke2fs 1.44.5 (15-Dec-2018)
/dev/md0 contains a ext4 file system labelled boot
created on Tue Mar 17 10:00:41 2020
Creating filesystem with 243968 4k blocks and 61056 inodes
Filesystem UUID: 40681f8d-535e-41e2-b0d8-14688f203b2e
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
Setting up swapspace version 1, size = 500 MiB (524283904 bytes)
no label, UUID=1515f8b9-e4a4-4afb-9807-dfd16441dd0e
mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 488093696 4k blocks and 122028032 inodes
Filesystem UUID: 1266df8f-625b-4776-b7eb-a60257428807
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
To view this entry in full, you must be a customer of Securebit AG. You can order any product from our range.
If you are already a customer, you can log in
here.