Apartma Matevž • Journal
🇬🇧 When the USB installation keeps failing — install Linux over the network.
🇬🇧 When the USB installation keeps failing — install Linux over the network.

🇬🇧 When the USB installation keeps failing — install Linux over the network.

Ustvarjeno 05.09.2026Posodobljeno 25.09.2026
ChatGPTApartmajiLinuxNetwork Boot

Kako je pokvarjen USB ključek pomagal postaviti dvojnik strežnika.

Yesterday, I got a new (used) server. Nothing fancy—just a small HP T630 thin client intended to serve as another server in my home network. The initial plan was simple: connect a monitor, boot the Ubuntu installer from a USB drive, and install the system.

Of course, things didn't go quite that way. 🙂 The installation kept failing with an I/O error. At this point, the question is always the same:

Is the problem the USB drive or the computer's internal drive?

And that question is more important than it seems. The BIOS "disk health" test might easily report that the drive is healthy. However, that doesn't guarantee the drive will successfully handle the actual writing of tens of gigabytes of data during installation. On the other hand, a USB drive might work perfectly fine most of the time and fail only at a specific block. So, I had two unknowns. Since I didn't have another USB drive handy, I did something else: I completely removed the USB drive from the equation.

Network boot

I set up a small PXE/proxyDHCP server using dnsmasq on one of my existing Linux servers. A key requirement was that I didn't want to interfere with the existing DHCP setup on the router. That’s why I used proxyDHCP mode. The server didn't assign IP addresses. It simply told the existing DHCP server:

“This computer wants to boot over the network. The boot image is here.”

And this is where I ran into an interesting little detail that took up most of my time.

Just dhcp-boot wasn't enough!

Initially, I had dhcp-match and dhcp-boot configured.

I could clearly see this in the logs:

PXEClient:Arch:00000

So, the server did see the PXE request.

But the computer simply wouldn't proceed.

The DHCP process just kept looping.

The problem was that the actual PXE ROM on the network card uses a slightly more specific PXE boot-server discovery process. The solution was to use explicit pxe-service directives for BIOS and EFI.

Once I added them, network booting simply started working.

And suddenly, the USB drive didn't matter anymore.

For the boot process, I used netboot.xyz on the mini-server and then selected Ubuntu Server from its menu.

---

But then something more interesting happened

# But then something more interesting happened

Once the new T630 finally had an OS installed, I realized I didn't actually want to set it up as a completely separate, blank test server.

-I wanted something far more useful:

a parallel copy of the current production environment.

Not a backup in the traditional sense.

Not a development environment.

But a shadow server.

A server that can use real production data but cannot modify production itself.

That is a crucial distinction.

# Shadow server

Simple idea:


             PRODUCTION
                 │
                 │ read only
                 ▼
          ┌──────────────┐
          │ SHADOW SERVER│
          └──────────────┘
                 │
                 ▼
             test / razvoj

Production remains production.

The new server can read its data but has no permission to write back.

This means I can test the following on it:

  • new application versions,
  • new modules,
  • migrations,
  • configuration,
  • new integrations,
  • architectural changes,

without the experiment affecting the actual system.

# Not git clone

I encountered another interesting detail here.

Part of the production system involved a Git checkout, but it was a shallow clone.

Therefore, a standard git bundle wasn't the right approach.

Instead, I opted for a simpler method:

rsyncing the entire checkout, including the .git folder.

This gives me a practical copy of the current working environment while keeping the Git metadata usable.

This is one of those situations where a simple solution is more useful than "correct" Git theory.

The most important part: data

When it came to the data, however, I didn't want to do this:

The shadow server has SSH access to production and could use a standard user key.

That is too broad.

Instead, I created a dedicated SSH key just for this task.

On the production server, the key in authorized_keys is restricted to:

rrsync -ro /path/to/folder

and additionally:

no-port-forwarding

Production remains production.

The new server can read its data but has no permission to write back. However, regarding the data, I didn't want to do this:

The shadow server has SSH access to production and can use a standard user key.

That is too broad.

Instead, I created a dedicated SSH key just for this task.

On the production server, the key in authorized_keys is restricted to:

no-X11-forwarding no-agent-forwarding no-pty

This way, the shadow server doesn't have "SSH access to production" in the general sense.

It has only one capability:

  • to read a specific directory.

That establishes a much better trust boundary.

One small pitfall with rrsync

There was an interesting detail here, too.

When rrsync restricts access to a specific directory, the client must not provide an absolute path again.

So, instead of:

server:/var/www/html/data

you use something like:

server:./

Because the root path is already defined by rrsync.

If you don't follow this, you can end up with some amusingly duplicated paths.

And then comes Git

Once I transferred the production data to the shadow server, a new problem arose.

Some JSON files were already present in the Git repository as development placeholders.

The production data overwrote them.

Git said immediately:

modified

However, these files must remain different on this specific installation.

I didn't want to modify the shared .gitignore because this isn't a general rule for the project.

Therefore, the right solution is a local one:

git update-index --skip-worktree path/to/file.json

And for new local files:

.git/info/exclude

This is a great example of the difference between:

“this file is ignored everywhere”

and:

“this file is intentionally different in this checkout.”

We don't just copy secrets willy-nilly

When setting up the shadow server, I also had to separate standard data from things like:

* TLS certificates, * private keys, * SMTP passwords, * signing certificates.

If something is owned by root:root with 600 permissions, I don't try to read it by force.

If a transfer is necessary, the administrator performs it via a one-off sudo operation, moving the file to the target server with the appropriate permissions.

This is an important rule:

The shadow environment should be a copy of the system, not a copy of all its secrets.

# One more thing I didn't expect

When copying a production application to another location, simply copying the files isn't enough.

Legacy applications often contain absolute paths:

https://production.example/...

or:

/var/www/html/old-app/...

On a shadow server, this can lead to very strange consequences.

The local application might inadvertently start calling the actual production system. Therefore, it was necessary to review:

* absolute URLs, * file system paths, * configuration, * modules, * external APIs.

In the process, I also encountered an interesting architectural issue.

# When a function is “missing”

When transitioning from the old monolithic version of the system to a newer modular version, it can happen that an old path returns:

404

The initial reaction is:

“Aha, the function is missing.”

But that isn't necessarily true.

The function might have been spun off into a standalone module or its own Git repository in the meantime.

Therefore, a better sequence of steps is:

  • 1. check if the function exists,
  • 2. check if it has become a standalone module,
  • 3. locate its new home,
  • 4. and only then fix or remove the old reference.

This is a lesson applicable far beyond this specific server.

# From a broken USB drive to a new architecture

And so, a rather mundane problem:

> “Ubuntu won't install.”

...led to something far more useful.

I ended up with:

  • a network boot environment,
  • a new server,
  • a copy of the production Git environment,
  • read-only access to real data,
  • a separate testing environment,
  • and, above all, the ability to develop on it without the fear of breaking anything in production.

The most interesting thing about projects like this is that the problem you initially just try to fix sometimes reveals a better architecture.

In this case, the problem was a USB flash drive.

But the solution wasn't a new USB drive.

The solution was:

network boot + shadow production environment.

And I think this T630 will be far more useful from now on than I had originally planned.