You are not logged in.

#1 2020-02-23 08:19:22

fTEVC
Member
Registered: 2020-02-23
Posts: 4

Replace an existing Linux system without LiveCD *or* swap partition

Hello, we are trying to replace the out-of-the-box operating system on a computer board (Atomic Pi) with Arch. The board has only one USB port, and as far as we can tell requires that you have a keyboard connected to enter the BIOS and change the boot order. For that reason, a live CD installation seems out of the question.

We followed the ArchWiki to the point of Replacing the existing system without a LiveCD below Install Arch Linux from existing Linux, but the only method described uses an extra swap partition, which we don't have (our system only has one partition for the root system, and one of EFI (FAT-12/16/32) formatting, which we assume is for the BIOS).

Against our best instincts, we thought about trying to create a partition along side the root system while it is running, but we have not proceeded with that because it seems like a bad idea.

Any advice on which route would be best to take in this situation?

Thanks!

Last edited by fTEVC (2020-02-23 08:30:58)

Offline

#2 2020-02-23 09:00:35

kermit63
Member
Registered: 2018-07-04
Posts: 174

Re: Replace an existing Linux system without LiveCD *or* swap partition

I'm not familiar with atomic pi, but if it's similar to raspberry pi, i.e. ARM architecture, then it is not supported by arch linux.

If you google around, you may find a fork of arch dedicated to ARM architecture, but it is not connected to arch and this forum. You may have better luck there.

Offline

#3 2020-02-23 09:21:01

frostschutz
Member
Registered: 2013-11-15
Posts: 1,418

Re: Replace an existing Linux system without LiveCD *or* swap partition

The board has only one USB port

and a regular USB hub does not solve this why...?

It's possible, but *dangerous* to replace the existing OS without a fallback (usb stick live cd or PXE boot, https://wiki.archlinux.org/index.php/PXE ). One wrong step and you have a system that no longer boots and locked yourself out, i.e. a brick.

You need a live system, pxe boot, rescue system, whatever and once you have that you already solved your problem and can do a complete regular install. If you really can't boot neither USB nor network, then you have to use one that is just kernel+initrd on your /boot partition (you can load PXE images locally that way) with a boot entry to go.

If you must risk it and you're happy with current filesystem layout and want to attempt it anyway how about the good old chroot bait and switch (provided enough free space on your / partition)

# simple dir on the existing rootfs, not a new filesystem
mkdir /archlinux

# install into it
pacstrap /archlinux 
arch-chroot /archlinux
...

# make / into /oldlinux, and /archlinux into / (from initramfs shell)
mount /dev/rootfs /rootfs
mkdir /rootfs/oldlinux
mv /rootfs/* /rootfs/oldlinux
mv /rootfs/oldlinux/archlinux/* /rootfs/

# now oldlinux rootfs is turned into archlinux rootfs, hope for the best

Last edited by frostschutz (2020-02-23 09:23:15)

Offline

#4 2020-02-24 05:30:51

atrotet
Member
From: Reunion island
Registered: 2010-12-28
Posts: 26

Re: Replace an existing Linux system without LiveCD *or* swap partition

kermit63 wrote:

I'm not familiar with atomic pi, but if it's similar to raspberry pi, i.e. ARM architecture, then it is not supported by arch linux.

If you google around, you may find a fork of arch dedicated to ARM architecture, but it is not connected to arch and this forum. You may have better luck there.

AtomicPi is not an ARM board, so he is posting on the right forums wink

and I second @frostschutz , a simple unpowered usb3 hub is all you need. I have a number of development boards and it is extremely useful to have one around...

Offline

#5 2020-02-27 04:04:15

fTEVC
Member
Registered: 2020-02-23
Posts: 4

Re: Replace an existing Linux system without LiveCD *or* swap partition

Hello everyone, just coming back to this, thanks for the replies.

atrotet wrote:

AtomicPi is not an ARM board, so he is posting on the right forums wink

That's right, Atomic Pi is x86, thanks for clarifying that. smile

frostschutz wrote:

and a regular USB hub does not solve this why...?

The problem is that the only way we can determine to trigger the BIOS menu (and hence change the boot order) is through a key sequence, so we have to use that USB port for a keyboard. We are realizing that maybe there is a way to boot directly to the BIOS menu from the linux command line, though, in which case we can initiate that through SSH and have the live system already connected. So we are going to investigate that.

Last edited by fTEVC (2020-02-27 04:06:26)

Offline

#6 2020-02-27 04:07:30

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,789

Re: Replace an existing Linux system without LiveCD *or* swap partition

Again, why can one not connect a four port unpowered hub to the system, and a keyboard and thumb drive to the hub?

https://www.amazon.com/AmazonBasics-4-P … B003M0NURK


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2020-02-27 14:05:21

blitz
Banned
Registered: 2014-06-14
Posts: 32

Re: Replace an existing Linux system without LiveCD *or* swap partition

fTEVC wrote:

Hello, we are trying to replace the out-of-the-box operating system on a computer board (Atomic Pi) with Arch. The board has only one USB port, and as far as we can tell requires that you have a keyboard connected to enter the BIOS and change the boot order. For that reason, a live CD installation seems out of the question.

The keyboard is still alive, presumably.

One does
i.

cat > /tmp/reinstall.sh
#! /bin/sh
for pkg in $(pacman -Q | cut -d' ' -f1); do
 pacman -S --noconfirm $pkg

ii.
chmod +x /tmp/reinstall.sh

iii.
Execute newly-made sudo /tmp/reinstall.sh

The problem is? With corrupted cheap media 16-32GB substituted for real.

Offline

Board footer

Powered by FluxBB