Skip to content
Snippets Groups Projects
Commit 0e7ad065 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

Initial debootstrap

parent 0badebb1
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
set -ex
DISK=$1
HOSTNAME=$2
[[ -z "$HOSTNAME" ]] && HOSTNAME=$(host $(ip addr | grep 'inet 147.251' | cut -d/ -f1 | sed 's/.*inet //') | sed 's/^.* \([a-z0-9]*\).fi.muni.cz.*$/\1/')
echo "installing $HOSTNAME to $DISK"
# MBR/DOS table
# new partition 1 spanning full disk
# LVM type partition
echo -e 'o\n' \
'n\np\n1\n\n\n' \
't\n8e\n' \
'p\n' \
'w\n'
| fdisk $DISK
pvcreate $DISK
VG=vg.$HOSTNAME
vgcreate $VG
lvcreate -L128G -n root
ROOTD=/dev/$VG/root
mkfs.xfs -m reflink=1 $ROOTD
ROOT=/mnt/root
mkdir -p $ROOT
mount $ROOTD $ROOT
deboostrap stable $ROOT http://ftp.cz.debian.org/debian/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment