diff options
| author | Don Delmar Davis <don@suspectdevices.com> | 2021-01-23 13:08:00 -0800 |
|---|---|---|
| committer | Don Delmar Davis <don@suspectdevices.com> | 2021-01-23 13:08:00 -0800 |
| commit | 9e9ad6e3bc215c3ea55ed9aa87609fe8878fb888 (patch) | |
| tree | 0175064a75bb3f7ac64e7f5dd123f2c88b4eb468 | |
| parent | ab53cbb32b10b3c9b79427b7ecfdf9183d16500e (diff) | |
More docs.
| -rw-r--r-- | README.md | 113 | ||||
| -rw-r--r-- | boot-disk-bash-history | 119 |
2 files changed, 226 insertions, 6 deletions
@@ -1,15 +1,117 @@ # Joey Rebuild # -An edgy server. Joey has 3 main jobs. Stage web content to be pushed or synced to external servers. Provide replication for the lan file servers disks. Provide container space both for lan/wan/edge services and to back up those provided by the file server. - +Joey (ramone) is an edgy server. Joey has 3 main jobs. Stage web content to be pushed or synced to external servers. Provide disk replication for the lan file servers. Provide container space both for lan/wan/edge services and to back up those provided by the file server. + ## Ubuntu 20.04 + zfs root on the Hp z400. Someday this will not be so hard :) As much as I like this little workhorse the bios on it kind of sucks. No UEFI. No booting from the on board raid. No booting from the external raid controller. -Tried to install the zfs root but the current installer only works with UEFI based bios's but much like the 18.04 install using the half baked on board controller it installs just fine but won't boot. So like the last install I just installed a minimal system and enough zfs tools to detect the installation and let grub find it. (then edit /etc/grub/default to boot to the zfs option and update-grub) +The current desktop installer can install zfs boot and root disks. It only works with UEFI based bios's but (much like the 18.04 install using the half baked on board psudo-raid controller) <em>it doesnt notice that your system doesnt support UEFI</em>. It installs just fine but won't boot. So like the last install I just installed a minimal system and enough zfs tools to detect the installation and let grub find it. (then edit /etc/grub/default to boot to the zfs option and update-grub) + +``` +... booting from minimal ... +# nano /etc/default/grub +... +GRUB_DEFAULT=2 +#GRUB_TIMEOUT_STYLE=hidden +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="verbose" +GRUB_CMDLINE_LINUX="text" +# update-grub +# reboot +``` + +While your fixing things get rid of the graphical desktop. + +``` +... booting from zfs installation ... +root@joey:/# systemctl set-default multi-user.target + +``` Then I added the mirror partitions. I didn't bother with the boot partitions on the mirror disk since they didn't work anyway. -Disk Layout. + + +### Disk Layout. + +* SSDs +* Archive disks + +### Network Configuration +[etc/netplan/50-cloud-init.yaml](etc/netplan/50-cloud-init.yaml) + +* br0 is the isp router side of the network and provides an anonymous bridge. +* br1 is the internal network and is configured to provide direct connection to the server. Set the MTU of this system to 9000 for large transfers between servers. + +### lxd setup. + +``` +... snap install lxd --channel=4.0/stable +root@joey:/home/don# apt-get install lxd +... +root@joey:/home/don# lxd init +Would you like to use LXD clustering? (yes/no) [default=no]: +Do you want to configure a new storage pool? (yes/no) [default=yes]: +Name of the new storage pool [default=default]: devil +Name of the storage backend to use (dir, lvm, zfs, ceph, btrfs) [default=zfs]: +Would you like to create a new zfs dataset under rpool/lxd? (yes/no) [default=yes]: no +Create a new ZFS pool? (yes/no) [default=yes]: +Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]: yes +Path to the existing block device: /dev/sdc2 +Would you like to connect to a MAAS server? (yes/no) [default=no]: +Would you like to create a new local network bridge? (yes/no) [default=yes]: no +Would you like to configure LXD to use an existing bridge or host interface? (yes/no) [default=no]: yes +Name of the existing bridge or host interface: br0 +Would you like LXD to be available over the network? (yes/no) [default=no]: yes +Address to bind LXD to (not including port) [default=all]: 192.168.129.65 +Port to bind LXD to [default=8443]: +Trust password for new clients: +Again: +Would you like stale cached images to be updated automatically? (yes/no) [default=yes] +Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: yes +config: + core.https_address: 192.168.129.65:8443 + core.trust_password: NOT_HERE +networks: [] +storage_pools: +- config: + source: /dev/disk/by-id/ata-TEAML5Lite3D240G_AB20190109A0101064-part2 + description: "" + name: devil + driver: zfs +profiles: +- config: {} + description: "" + devices: + eth0: + name: eth0 + nictype: bridged + parent: br0 + type: nic + root: + path: / + pool: devil + type: disk + name: default +cluster: null + +``` +### Restoring profiles and containers from lan file server. + +``` +root@annie:/home/don# lxc remote remove joey +root@annie:/home/don# lxc remote add joey +Certificate fingerprint: 2ad747d1305470bfd6787c1451e0ab64e22ab1798ae78d113718205763639742 +ok (y/n)? yes +Admin password for joey: +Client certificate stored at server: joey +root@annie:/home/don# lxc profile copy infra joey: +root@annie:/home/don# lxc profile copy susdev20 joey: +root@annie:/home/don# lxc profile copy susdev21 joey: +root@annie:/home/don# lxc move nina joey: + +``` ### linkdump * [https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/Ubuntu%2020.04%20Root%20on%20ZFS.html#rescuing-using-a-live-cd](https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/Ubuntu%2020.04%20Root%20on%20ZFS.html#rescuing-using-a-live-cd) @@ -18,8 +120,7 @@ Disk Layout. * [https://www.reddit.com/r/linuxadmin/comments/j8qzdq/install_ubuntu_server_2004_on_a_zfs_root/](https://www.reddit.com/r/linuxadmin/comments/j8qzdq/install_ubuntu_server_2004_on_a_zfs_root/) * [https://www.medo64.com/2020/04/installing-uefi-zfs-root-on-ubuntu-20-04/](https://www.medo64.com/2020/04/installing-uefi-zfs-root-on-ubuntu-20-04/) -##### lxd setup. -* https://linuxcontainers.org/lxd/docs/master/storage +### lxd setup. ``` ... snap install lxd --channel=4.0/stable diff --git a/boot-disk-bash-history b/boot-disk-bash-history new file mode 100644 index 0000000..efa5cca --- /dev/null +++ b/boot-disk-bash-history @@ -0,0 +1,119 @@ +apt-get install openssh-server +reboot +apt install --yes debootstrap gdisk zfs-initramfs mdadm grub-pc linux-image-generic zsys +zpool import rpool +zpool import bpool +zpool list +zpool status +zpool status -L +grub-probe +nano /boot/grub/grub.cfg +update-grub +zpool export -a +zpool import -N -R /mnt rpool +zpool import -N -R /mnt bpool +zfs load-key -a +zfs mount -a +zpool list +mount --rbind /dev /mnt/dev +mount --rbind /proc /mnt/proc +mount --rbind /sys /mnt/sys +mount -t tmpfs tmpfs /mnt/run +chroot /mnt /bin/bash --login +mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -i{} umount -lf {} +zpool export -a + +cd /etc/grub.d/ +nano /etc/default/grub +update-grub +cat /boot/grub/grub.cfg +reboot +nano /etc/default/grub +update-grub +reboot + +fdisk -l +zfs list +zpool list +apt-get install gparted +zpool list -L +zpool import +zpool list -L +zpool export +zpool export rpool +zpool import rpool +zpool import bpool +zpool export rpool +zpool import rpool +zpool list -L +zpool status -L +fdisk -l +gparted /dev/sde +fdisk /dev/sde + +fdisk /dev/sde +ls -lsa /dev/disk/by-partuuid/|grep sde +zpool create nrpool b8402382-6255-4147-8b94-a15620115682 +zfs list +zpool +zpool list +zpool export rpool +zpool import rpool oldrpool +mkdir /oldroot /newroot +zpool list +zpool import -R/oldroot oldrpool +zpool export oldrpool +zpool import -R/oldroot oldrpool +zpool import -R/newroot nrpool rpool +zpool export nrpool +zpool list +zpool import +zpool import -R/newroot 4103281169370239104 rpool +update-grub +zfs snapshot -r oldrpool@for_copy +zfs send -R oldrpool@for_copy | zfs recv -F rpool +zpool list +zpool import +zpool status -L +zpool import sde6 +zpool import /dev/sde6 +ls -ls /dev/disk/by-partuuid/|grep sde6 +zpool attach bpool d3bff208-06 a78a37d3-9208-4642-8c3e-669fe656fce9 +zpool status bpool +zpool detach bpool d3bff208-06 +zpool status bpool +zpool status +zpool status rpool +update-grub +fdisk -l + +sgdisk -p /dev/sde +sgdisk -R/dev/sdc /dev/sde +sgdisk -G /dev/sdc +zpool status +zpool export oldrpool +zpool status +ls -ls /dev/disk/by-partuuid/|grep sdc6 +zpool attach bpool a78a37d3-9208-4642-8c3e-669fe656fce9 27d620c0-09a7-41e2-9299-75533c6dff2f +zpool status +ls -ls /dev/disk/by-partuuid/|grep sdc7 +ls -ls /dev/disk/by-partuuid/|grep sdc +fdisk -L +fdisk -l +partprobe +ls -ls /dev/disk/by-partuuid/|grep sdc7 +zpool status rpool +zpool status rpool -L +zpool attach rpool b8402382-6255-4147-8b94-a15620115682 57547a25-5c28-4b96-a0d5-8b277ae31a43 +zpool attach rpool b8402382-6255-4147-8b94-a15620115682 57547a25-5c28-4b96-a0d5-8b277ae31a43 -o ashift=9 +zpool status +zpool list +zpool set +zpool set altroot=/ rpool +zpool export rpool +zpool status +zpool import -R/ rpool +zpool status +zpool list +update-grub +reboot |
