Laptop installation script/guide

Having to have access to reinstall my laptop, I’m putting this up. Mirrored Encrypted ZFS configuration.

Verify actual disks by doing ls -l on the $DISK Variable. May switch between reboots. 

DISK1=/dev/disk/by-id/nvme-CT4000P3PSSD8_2252E6966FC3
DISK2=/dev/disk/by-id/nvme-CT4000P3PSSD8_2240E671E0D3


DISK2=/dev/disk/by-id/nvme-CT4000P3PSSD8_2252E6966FC3
DISK1=/dev/disk/by-id/nvme-CT4000P3PSSD8_2240E671E0D3

HOST=fafnir
USER=alan
POOL=UbuntuZFS

blkdiscard -f $DISK1

sgdisk --zap-all $DISK1
sgdisk -n1:1M:+127M -t1:EF00 -c1:EFI $DISK1
sgdisk -n2:0:+1920M -t2:8300 -c2:Boot $DISK1
sgdisk -n3:0:+64G -t3:8200 -c3:Swap $DISK1
sgdisk -n4:0:0 -t4:BF00 -c4:Pool $DISK1
sgdisk --print $DISK1

PART1UUID='blkid -s PARTUUID -o value $DISK1-part1'
PART2UUID='blkid -s PARTUUID -o value $DISK1-part2'

blkdiscard -f $DISK2 2>/dev/null
sgdisk --zap-all $DISK2
sgdisk -n1:1M:+127M -t1:EF00 -c1:EFI -u1:$PART1UUID $DISK2
sgdisk -n2:0:+1920M -t2:8300 -c2:Boot -u2:$PART2UUID $DISK2
sgdisk -n3:0:+64G -t3:8200 -c3:Swap -u3:R $DISK2
sgdisk -n4:0:0 -t4:BF00 -c4:POOL -u4:R $DISK2


For a non-mirrored boot configuration
. Making the partitions size match to ZFS doesn't complain on the mirror creation.


blkdiscard -f $DISK2 2>/dev/null
sgdisk --zap-all $DISK2
sgdisk -n1:1M:+127M -t1:EF00 -c1:EFI -u1:R $DISK2
sgdisk -n2:0:+1920M -t2:8300 -c2:Boot -u2:R $DISK2
sgdisk -n3:0:+64G -t3:8200 -c3:Swap -u3:R $DISK2
sgdisk -n4:0:0 -t4:BF00 -c4:POOL -u4:R $DISK2


zpool create -o ashift=12 -o autotrim=on \
-O compression=lz4 -O normalization=formD \
-O acltype=posixacl -O xattr=sa -O dnodesize=auto -O atime=off \
-O encryption=aes-256-gcm -O keylocation=prompt -O keyformat=passphrase \
-O canmount=off -O mountpoint=none -R /mnt/install $POOL mirror $DISK1-part4 $DISK2-part4





zfs create -o canmount=noauto -o mountpoint=/ $POOL/root
zfs mount $POOL/root

zfs create -o canmount=noauto -o mountpoint=/home $POOL/home
zfs mount $POOL/home
zfs set canmount=on $POOL/home

zfs create -o canmount=noauto -o mountpoint=/var $POOL/var
zfs mount $POOL/var
zfs set canmount=on $POOL/var

zfs create -o canmount=noauto -o mountpoint=/var/lib $POOL/var/lib
zfs mount $POOL/var/lib
zfs set canmount=on $POOL/var/lib


replicant data sets are for data that is replicated elsewhere (e.g. Dropbox or Nextcloud) or not desired to be in the home directory

zfs create -o canmount=noauto -o mountpoint=/mnt/replicant $POOL/replicant
zfs mount $POOL/replicant
zfs set canmount=on $POOL/replicant

zfs create -o canmount=noauto -o mountpoint=/mnt/replicant/Dropbox $POOL/replicant/Dropbox
zfs mount $POOL/replicant/Dropbox
zfs set canmount=on $POOL/replicant/Dropbox

zfs create -o canmount=noauto -o mountpoint=/mnt/replicant/Nextcloud $POOL/replicant/Nextcloud
zfs mount $POOL/replicant/Nextcloud
zfs set canmount=on $POOL/replicant/Nextcloud

zfs create -o canmount=noauto -o mountpoint=/mnt/replicant/storage $POOL/replicant/storage
zfs mount $POOL/replicant/storage
zfs set canmount=on $POOL/replicant/storage

yes | mkfs.ext4 $DISK1-part2
mkdir /mnt/install/boot

mount $DISK1-part2 /mnt/install/boot/

mkfs.msdos -F 32 -n EFI -i 4d65646f $DISK1-part1
mkdir /mnt/install/boot/efi

mount $DISK1-part1 /mnt/install/boot/efi

apt update
apt install --yes debootstrap
debootstrap noble /mnt/install/

echo $HOST > /mnt/install/etc/hostname
sed "s/ubuntu/$HOST/" /etc/hosts > /mnt/install/etc/hosts
cp /etc/netplan/*.yaml /mnt/install/etc/netplan/

mount --rbind /dev /mnt/install/dev
mount --rbind /proc /mnt/install/proc
mount --rbind /sys /mnt/install/sys
chroot /mnt/install /usr/bin/env \
DISK1=$DISK1 DISK2=$DISK2 HOST=$HOST USER=$USER \
bash --login


Inside CHROOT

locale-gen --purge "en_US.UTF-8"
update-locale LANG=en_US.UTF-8 LANGUAGE=en_US
dpkg-reconfigure --frontend noninteractive locales

ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
dpkg-reconfigure -f noninteractive tzdata

apt update
apt install --yes --no-install-recommends \
linux-image-generic linux-headers-generic \
zfs-initramfs \
cryptsetup \
keyutils \
grub-efi-amd64-signed \
shim-signed \
zstd

echo "swap $DISK1-part3 /dev/urandom \
swap,cipher=aes-xts-plain64,size=256,plain" >> /etc/crypttab

echo "swap $DISK2-part3 /dev/urandom \
swap,cipher=aes-xts-plain64,size=256,plain" >> /etc/crypttab

cat /etc/crypttab


echo "PARTUUID=$(blkid -s PARTUUID -o value $DISK1-part2) /boot ext4 noatime,nofail,x-systemd.device-timeout=5s 0 1" >> /etc/fstab
echo "PARTUUID=$(blkid -s PARTUUID -o value $DISK1-part1) \
/boot/efi vfat noatime,nofail,x-systemd.device-timeout=5s 0 1" >> /etc/fstab
echo "/dev/mapper/swap none swap defaults 0 0" >> /etc/fstab


cat /etc/fstab


/etc/init.d/cryptdisks restart && sleep 5
swapon -a

echo "vm.swappiness=10" >> /etc/sysctl.conf
echo "vm.min_free_kbytes=1048576" >> /etc/sysctl.conf

echo "fs.inotify.max_user_watches = 524288" >> /etc/sysctl.conf
echo "
HandleLidSwitch=ignore" >> /etc/systemd/logind.conf
update-initramfs -c -k all

update-grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Ubuntu \
--recheck --no-floppy


We need to install the Desktop first to be able to add the repo:

apt install ubuntu-desktop



Add a couple essential tools:


add-apt-repository universe
add-apt-repository restricted
add-apt-repository multiverse
apt update
bash-completion \
nano \
curl \
gparted \
smartmontools \
sanoid \
plocate


apt dist-upgrade --yes

mkdir /etc/sanoid
wget -O /etc/sanoid/sanoid.defaults.conf https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.defaults.conf
wget -O /etc/sanoid/sanoid.conf https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.conf


adduser --disabled-password --gecos '' $USER
usermod -a -G adm,cdrom,dip,lpadmin,plugdev,sudo $USER
echo "$USER ALL=NOPASSWD:ALL" > /etc/sudoers.d/$USER
passwd $USER




wget -O- http://packages.medo64.com/keys/medo64.asc | sudo tee /etc/apt/trusted.gpg.d/medo64.asc
echo "deb http://packages.medo64.com/deb stable main" | sudo tee /etc/apt/sources.list.d/medo64.list
apt update
apt install -y syncbootpart
syncbootpart

dd if=$DISK1-part1 of=$DISK2-part1
dd if=$DISK1-part2 of=$DISK2-part2
update-grub


exit

Out of CHROOT

sync
umount /mnt/install/boot/efi
umount /mnt/install/boot
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -i{} umount -lf {}
zpool export -a

reboot

Post install setup:

wget -O dropbox.deb https://www.dropbox.com/download?dl=packages/ubuntu/dropbox_2025.05.20_amd64.deb

sudo dpkg -i dropbox.deb
rm dropbox.deb


wget -O vivaldi.deb https://downloads.vivaldi.com/stable/vivaldi-stable_7.5.3735.62-1_amd64.deb
sudo dpkg -i vivaldi.deb
rm vivaldi.deb

wget -O ~/Appimages/nextcloud.AppImage https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-3.17.0-x86_64.AppImage
chmod +x ~/Appimages/nextcloud.AppImage

After recovering the .ssh folder, run
ssh-add
to import identities.

Signal Messenger:

wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg;
cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null

# 2. Add our repository to your list of repositories:
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |\
sudo tee /etc/apt/sources.list.d/signal-xenial.list

# 3. Update your package database and install Signal:
sudo apt update && sudo apt install signal-desktop

#Mattermost Desktop
curl -fsS -o- https://deb.packages.mattermost.com/setup-repo.sh | sudo bash
sudo apt update && sudo apt install mattermost-desktop

SuperMicro IMPI View
IMPI View
https://www.supermicro.com/en/support/resources/downloadcenter/smsdownload?category=IPMI



Master PDF:

Dungeon Draft
Wonder Draft

Zoom

sudo apt install keepassxc evolution vlc gimp imagemagick nautilus-nextcloud nautilus-image-converter plocate libfuse2

Nomachine
https://www.nomachine.com

Fix wireplumber issue:

sudo apt install libcamera-ipa pipewire-libcamera

2024-2025 Home school year in review

for
Jarek Johnson
Arya Johnson
Evan Johnson

Our 2024-2025 school year picked up on the road, continuing our travels around the country in Yellowstone National Park. From there, we traveled to many other sites on our way back to Florida, to include:

Grand Tetons NP
Little Big Horn National Monument
Fort Union Trading Post
Theodore Roosevelt National Park
Knife River Historic Site
Devils Tower
Wind Cave National Park
Mt. Rushmore
Jewel Cave National Monument
Homestake Gold Mine
Minuteman Missile NHS
Badlands National Park
Agate fossil Beds NM
Scotts Bluff NM
Fort Laramie & Guernsey Wagon Ruts
Homestead NHP
Brown V. Board of Education NHS
Fort Larned NHS
Tallgrass Prairie NP
Strataca – Kansas underground salt museum / salt mine
Chickamauga & Chattanooga NMP
Russel Cave NM
Little River Canyon Nat. Preserve

Arriving back in Florida, we took a break for Thanksgiving and started to get back into the book work.

I logged their work on a blog post (pdf file) from December to January. After January, we switched to homeschool sheets where they documented what they did for that day.

From November to March we were living in the RV, conducting home school in the RV or outside on the patio. After April on we moved back into our house. Due to the efforts required with the move, we stopped most book work activities in April and through the summer.

Over the summer the three attended several summer camps with the Scouts. Jarek earned over 14 merit badges this summer in a variety of subjects and activities. Jarek worked on Saxon math 7/8 and the more advanced writing program which introduced outlines in preparation for writing papers. He has done very well with his reading, reading numerous book. He also took violin lessons and scored well on his Theory exam. I’ve looked for his results for his recorded performance, but I appear to not have them.

Bookwork samples are available via your provided login at https://photos.argentwolf.org

September 2024:

Old Faithful.

Dragon mouth spring.

Grand Teton National Park

Theodore Roosevelt National Park

Knife River Indian Villages

Devils Tower

Geographic Center of the US

Mt. Rushmore

Wind Cave N. P.

October 2024

Wonderland Cave

The former Homestake Gold Mine, now a physics research facility.

Minuteman NM.

Badlands N.P.

Needles Hwy & Scenic Drive

Agate Fossil Beds NM

Fort Laramie

Guernsey / Oregon Trail wagon ruts.

Register Cliff

Scotts Bluff NM

The Northern Lights as seen by the naked eye while we were in Nebraska.

The same image as seen by the phone in night mode.

Homestead NHP

Brown v. Board of Education NHP

Strataca Salt Mine & Museum, 600′ under Kansas

Tallgrass Prairie Nat. Preserve

Comet Atlas photo taken at a park in Kansas.

Fort Scott NHS

Pea Ridge NMP and Trail of Tears

Fort Smith NHS

Little Rock Central High School

November 2024

Visiting a Nasa STEM Science Fair in Huntsville, AL.

The view from Point Park at Chickamauga-Chattanooga battlefield.

Garrett explores a touch table at Russell Cave National Monument

Russell Cave NM

Visiting the Little River Canyon NM.

Exploring the cave at Raccoon Mountain.

Visiting Fort Pulaski.

Back in Florida!

Jan 2025

Jarek got a metal detector for Yule. He began exploring the yard for lost treasures with his little helper.

Evan and Arya work the Climbing tower

Jarek takes a turn on the climbing tower.

Placing wreathes on Veterans’ graves.

Cold weather camping near Mariana, FL.

Jarek visited the Florida state caverns near Mariana with his Scout Troop.

Everyone went to the Cub Scout Bike Rodeo to learn about bike safety.

Evan assembles his table for a Cub Scout activity.

Jarek helps assemble a goat milking stand.

The kids took turns helping sand and finish the goat stand.

Goat stand complete, Alan and Jarek work on the goat shelter.

Our first batch of baby chicks. The kids build a popsicle stick play structure for the chicks.

Jarek and Evan help move compost for the raised bed gardens.

Jarek attended a Scout leadership training. Each of the Scouts in the group was given a different disability (can’t see, can’t talk, can’t use arms, can’t walk) and they had to complete an obstacle course.

Jarek works on a bat house for a Scout conservation requirement.

March 2025

Two of our dairy goats. The kids learned how to milk them and help take care of them.

The kids help pull furniture and other items out of storage as we move back into the house.

April 2025

Jarek attends the Sun N Fun airshow with the Scout Troop.

Evan drills with his soccer team.

Evan milks one of our goats, Chali.

June 2025

Jarek helps make nesting boxes for the chicken tractor that Alan built.

Evan inspects the inside of the chicken tractor.

Camp Woodruff Summer Camp with his Troop.

Jarek attends a week at Camp Shands Scout Summer camp by himself!

A Pressing Matter! – Making homemade cider

Today we processed some apples into homemade apple cider.  We combined the event with a Cub Scout requirement for the Bear Den.  The kids had a lot of fun sorting the apples and removing the bad apples from the bunch.  This was a smaller batch than what we did last year, due to the upcoming move.  Last year I made 15 gallons of cider which I fermented into hard cider, on top of some additional regular cider.

Once the apples were washed and sorted, then it was time to grind them up.  I don’ have a picture of them using the grinder, but you can see it on the ground in the pictures below.

The grinder, known as the “maximizer” grinds the apples into chunks which increases the juice yield.

Our friend and fellow Cub Scout, B, pressing his apples.

Garrett enjoyed some frozen blueberries for a snack before his nap.

Evan took a turn cranking down the press, followed by big brother.

Out of the three bags of apples, we got about 4 gallons of juice.  The bags of seconds were $8 each, so not a bad yield.  The kids asked what we were going to do with the rest of the apples.  I said we were going to convert them to eggs!  The chickens were quite thrilled to get the pile to pick through.