Pour du partitionnement MBR standard :
apt-get -y install lvm2 (echo o; echo n; echo p; echo 1; echo ; echo; echo t; echo 8E; echo w) | fdisk /dev/sdc pvcreate /dev/sdc1 vgcreate VG-BACKUP /dev/sdc1 lvcreate -l 100%VG -n LV-BACKUP VG-BACKUP mkfs.ext4 -m 0 -i 10240 -J size=400 -b 4096 /dev/mapper/VG--BACKUP-LV--BACKUP mkdir /backup echo "/dev/mapper/VG--BACKUP-LV--BACKUP /backup ext4 defaults 0 0" >> /etc/fstab mount /backup
Pour du GPT, indispensable pour des partitions de plus de 2To :
apt-get -y install lvm2 parted parted /dev/sdc -s "mklabel gpt" parted /dev/sdc -s "mkpart 8E 1 -1" pvcreate /dev/sdc1 vgcreate VG-BACKUP /dev/sdc1 lvcreate -l 100%VG -n LV-BACKUP VG-BACKUP mkfs.ext4 -m 0 -i 10240 -J size=400 -b 4096 /dev/mapper/VG--BACKUP-LV--BACKUP mkdir /backup echo "/dev/mapper/VG--BACKUP-LV--BACKUP /backup ext4 defaults 0 0" >> /etc/fstab mount /backup