xen guest // install netbsd on extfs from gnu/linux

malabar-ext2fs | malabar-ext2fs-boot | xen guest-netbsd-ext2fs | kvm guest-netbsd-ext2fs

requirements

grab some netbsd/xen kernel

and prepare the install script

cd /data/guests/

wget https://pub.nethence.com/bin/bsd/installext2fs.bash
wget https://pub.nethence.com/bin/bsd/installext2fs.conf
chmod +x installext2fs.bash

deploy

XEN PV

guest=nbext2fs

mkdir -p /data/guests/$guest/
cd /data/guests/$guest/

–either– sparse file

#rm -f $guest.ext2
    dd if=/dev/zero of=$guest.ext2 bs=1G count=0 seek=10
# bs=1000k count=0 seek=4000

–or– XEN + DRBD (DNC)

dnc-list-slots.bash
dnc-new-resource-template.bash pmr3 pmr1 47 $guest

define network parameters that will be pushed into the guest image

cat ~/.ssh/id_*.pub

# https://pub.nethence.com/bin/bsd/installext2fs.conf
vi installext2fs.conf

pubkey="..."

(tune accordingly)

–either– deploy against a sparse file with no partition (XEN)

# https://pub.nethence.com/bin/bsd/installext2fs.bash
../installext2fs.bash $guest $guest.ext2

–or– deploy against a sparse file with partitions (KVM)

../installext2fs.bash $guest $guest.ext2

–or– against DNC vdisk (XEN + DRBD)

../installext2fs.bash $guest /dev/drbd/by-res/$guest/0

xen guest skeleton

cat > $guest <<EOF
#kernel = "/data/kernels/netbsd/netbsd-INSTALL_XEN3_DOMU.gz"
kernel = "/data/kernels/netbsd/netbsd-XEN3_DOMU.gz"
root = "xbd0a"
#extra = "-v -s"
memory = 1024
name = "$guest"
vcpus = 3
disk = ['tap:tapdisk:aio:/data/guests/$guest/$guest.ext2,xvda,w',
        'tap:tapdisk:aio:/data/guests/$guest/$guest.data.ext2,xvdb,w']
vif = [ 'bridge=xenbr0,vifname=$guest' ]
EOF

ready to go

for xen

    xl create $guest -c

for dnc

dnc-list-templates.bash | grep bsd
dnc-list-slots.bash
dnc-new-resource.bash $guest 48 powerbsd
dnc-newguest-netbsd.bash 48 powerbsd

resources

partitions

https://en.wikipedia.org/wiki/Disk_partitioning

https://en.wikipedia.org/wiki/Partition_type

http://man7.org/linux/man-pages/man1/dd.1.html

https://www.rodsbooks.com/gdisk/sgdisk.html

https://linux.die.net/man/8/sgdisk

https://www.rodsbooks.com/gdisk/sgdisk-walkthrough.html

https://www.rodsbooks.com/gdisk/wipegpt.html

https://unix.stackexchange.com/questions/12986/how-to-copy-the-partition-layout-of-a-whole-disk-using-standard-tools ==> sfdisk

https://en.wikipedia.org/wiki/GUID_Partition_Table#Hybrid_MBR_(LBA_0+GPT)

netbsd

http://netbsd.gw.com/cgi-bin/man-cgi?disklabel+8

http://netbsd.gw.com/cgi-bin/man-cgi?mount+8+NetBSD-current

http://netbsd.gw.com/cgi-bin/man-cgi?fstab+5+NetBSD-current

Default How should I use ext2 in OpenBSD? http://daemonforums.org/showthread.php?t=9572

ext2

https://en.wikipedia.org/wiki/Ext2

https://wiki.osdev.org/Ext2

https://linux.die.net/man/8/debugfs

http://cs.smith.edu/~nhowe/Teaching/csc262/oldlabs/ext2.html

https://homepage.smc.edu/morgan_david/cs40/analyze-ext2.htm

troubles

Remount a busy disk to read-only mode https://unix.stackexchange.com/questions/195010/remount-a-busy-disk-to-read-only-mode

disklabel: ioctl DIOCGDINFO: Inappropriate ioctl for device https://mail-index.netbsd.org/netbsd-users/2010/05/01/msg006145.html

disklabel: ioctl DIOCGDINFO: Inappropriate ioctl for device http://gnats.netbsd.org/36609

grub-install: warning: Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet.. during installing GRUB #61 https://github.com/slacka/WoeUSB/issues/61

https://lists.freebsd.org/pipermail/freebsd-questions/2003-November/027308.html

https://forums.freebsd.org/threads/search-for-alternate-super-block-failed.16984/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun