Add sleep 2 after parted command
This commit is contained in:
parent
ff958d5b56
commit
650f9369a0
|
@ -55,11 +55,11 @@ apt install -y coreutils debootstrap e2fsprogs gawk ipcalc lvm2 thin-provisionin
|
||||||
# }}}
|
# }}}
|
||||||
# Partitionning {{{
|
# Partitionning {{{
|
||||||
if [ "${manage_part}" -eq 0 ]; then
|
if [ "${manage_part}" -eq 0 ]; then
|
||||||
## Remove all old partitions
|
## Remove all old partitions {{{
|
||||||
for part_number in 1 2 3 4 5 6 7 8; do
|
for part_number in 1 2 3 4 5 6 7 8; do
|
||||||
[ -b "${hdd}""${part_number}" ] && parted "${hdd}" rm "${part_number}"
|
[ -b "${hdd}""${part_number}" ] && parted "${hdd}" rm "${part_number}"
|
||||||
done
|
done
|
||||||
|
## }}}
|
||||||
## Recreate partition (/boot and LV) {{{
|
## Recreate partition (/boot and LV) {{{
|
||||||
### Partition type
|
### Partition type
|
||||||
parted "${hdd}" mklabel msdos || exit 1
|
parted "${hdd}" mklabel msdos || exit 1
|
||||||
|
@ -68,17 +68,20 @@ if [ "${manage_part}" -eq 0 ]; then
|
||||||
### /boot
|
### /boot
|
||||||
parted "${hdd}" mkpart primary 0% 512MB || exit 1
|
parted "${hdd}" mkpart primary 0% 512MB || exit 1
|
||||||
parted "${hdd}" set 1 boot on
|
parted "${hdd}" set 1 boot on
|
||||||
|
sleep 2
|
||||||
mkfs.ext3 -F -L boot -- "${hdd}"1 || exit 4
|
mkfs.ext3 -F -L boot -- "${hdd}"1 || exit 4
|
||||||
|
|
||||||
### LV
|
### LV
|
||||||
root_part_id="2"
|
root_part_id="2"
|
||||||
parted "${hdd}" mkpart primary 512MB 100% || exit 1
|
parted "${hdd}" mkpart primary 512MB 100% || exit 1
|
||||||
parted "${hdd}" set "${root_part_id}" lvm on
|
parted "${hdd}" set "${root_part_id}" lvm on
|
||||||
|
sleep 2
|
||||||
else
|
else
|
||||||
### LV
|
### LV
|
||||||
root_part_id="1"
|
root_part_id="1"
|
||||||
parted "${hdd}" mkpart primary 0% 100% || exit 1
|
parted "${hdd}" mkpart primary 0% 100% || exit 1
|
||||||
parted "${hdd}" set "${root_part_id}" lvm on
|
parted "${hdd}" set "${root_part_id}" lvm on
|
||||||
|
sleep 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${manage_luks}" -eq 0 ]; then
|
if [ "${manage_luks}" -eq 0 ]; then
|
||||||
|
@ -114,7 +117,7 @@ if [ "${manage_part}" -eq 0 ]; then
|
||||||
[ ! -b /dev/mapper/"${vgname}"-swap ] && lvcreate -n swap -L 4g "${vgname}"
|
[ ! -b /dev/mapper/"${vgname}"-swap ] && lvcreate -n swap -L 4g "${vgname}"
|
||||||
## }}}
|
## }}}
|
||||||
## Format Logical Volumes {{{
|
## Format Logical Volumes {{{
|
||||||
### Format LVs in ext4
|
### Format LVs in ext4
|
||||||
cd -- /dev/"${vgname}" || exit 1
|
cd -- /dev/"${vgname}" || exit 1
|
||||||
for lvname in *; do
|
for lvname in *; do
|
||||||
mkfs.ext4 -F -L "${lvname}" -- "${lvname}" || exit 4
|
mkfs.ext4 -F -L "${lvname}" -- "${lvname}" || exit 4
|
||||||
|
@ -130,8 +133,8 @@ if [ "${manage_part}" -eq 0 ]; then
|
||||||
### And format the swap
|
### And format the swap
|
||||||
mkswap -L sw01 -- /dev/mapper/"${vgname}"-swap || exit 4
|
mkswap -L sw01 -- /dev/mapper/"${vgname}"-swap || exit 4
|
||||||
## }}}
|
## }}}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
# Debootstrap {{{
|
# Debootstrap {{{
|
||||||
## Create and mount the system {{{
|
## Create and mount the system {{{
|
||||||
|
|
Loading…
Reference in New Issue