this post was submitted on 01 Sep 2024
42 points (100.0% liked)

Linux

1258 readers
80 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I like my Linux installs heavily customized and security hardened, to the extent that copying over /home won't cut it, but not so much that it breaks when updating Debian. Whenever someone mentions reinstalling Linux, I am instinctively nervous thinking about the work it would take for me to get from a vanilla install to my current configuration.

It started a couple of years ago, when dreading the work of configuring Debian to my taste on a new laptop, I decided to instead just shrink my existing install to match the new laptop's drive and dd it over. I later made a VM from my install, stripped out personal files and obvious junk, and condensed it to a 30 GB raw disk image, which I then deployed on the rest of my machines.

That was still a bit too janky, so once my configuration and installed packages stabilized, I bit the bullet, spun up a new VM, and painstakingly replicated my configuration from a fresh copy of Debian. I finished with a 24 GB raw disk image, which I can now deploy as a "fresh" yet pre-configured install, whether to prepare new machines, make new VMs, fix broken installs, or just because I want to.

All that needs to be done after dd'ing the image to a new disk is:

  • Some machines: boot grubx64.efi/shimx64.efi from Ventoy and "bless" the new install with grub-install and update-grub
  • Reencrypt LUKS root partition with new password
  • Configure user and GRUB passwords
  • Set hostname
  • Install updates and drivers as needed
  • Configure for high DPI if needed

I'm interested to hear if any of you have a similar workflow or any feedback on mine.

top 11 comments
sorted by: hot top controversial new old
[–] Unmapped@lemmy.ml 35 points 2 months ago (1 children)

You should check out Nixos. You make a config file that you can just copy over to as many machines as you want.

[–] 4am@lemm.ee 5 points 2 months ago (1 children)

That or Ansible, if you will have a machine to deploy from

[–] possiblylinux127@lemmy.zip 1 points 2 months ago

You don't need a machine to deploy from. You just need a git repo and Ansible pull. It will pulldown and run playbooks against the host. (Use the self target to run it on the local machine)

[–] possiblylinux127@lemmy.zip 4 points 2 months ago* (last edited 2 months ago)

Use configuration tooling such as Ansible.

You also could build a image builder to build your system. You could utilize things like docker and or Ansible to repeatedly get to the same result.

[–] darius@lemmy.ml 2 points 2 months ago

I have the exact same workflow except I have two images: one for legacy/MBR and another for EFI/GPT -- once I read your post I was glad to see I'm not alone haha!

[–] boredsquirrel@slrpnk.net 2 points 2 months ago

I did the same, exactly the way you did but my "zygote" isnt as advanced.

I should make a raw ISO too, but currently I just use Clonezilla (which shrinks and resizes automatically) and have a small SSD with a nearly vanilla system.

Just because the Fedora ISO didnt boot

[–] data1701d@startrek.website 2 points 2 months ago (1 children)

You might be able to script something with Debootstrap. I tested Bcachefs on a spare device once and couldn't get through the standard Debian install process, so I ended up using a live image to Debootstrap the drive. You should be able to give a list of packages to install and copy over configs to the partition.

[–] possiblylinux127@lemmy.zip 1 points 2 months ago

Ansible and docker would work nicely for this

[–] ezekielmudd@reddthat.com 1 points 2 months ago (1 children)

I believe that Proxmox does this because I have installed/created containers from their available images. I wonder how they create those container images?

[–] possiblylinux127@lemmy.zip 1 points 2 months ago

There are many way to make a image

[–] 2xsaiko@discuss.tchncs.de 1 points 2 months ago

This is designed for Gentoo but I've used it for Ubuntu before: https://github.com/TheChymera/mkstage4/