takes about 10 minutes to setup
ssh root@the-ip
uname -a
showed me:
Linux arm-gc.local.lan 4.4.0-38-generic #57-Ubuntu SMP Wed Sep 7
10:19:14 UTC 2016 aarch64 aarch64 aarch64 GNU/Linux
- Disable swap and format as ext4
Looking at /etc/fstab
and then ls -la /dev/disk/by-uuid
I found my
swap was at /dev/sda2
.
swapoff /dev/sda2; mkfs.ext4 /dev/sda2
The mkfs.ext4
should prompt about it being a swap filesystem, say
yes.
Mount /dev/sda2
to /mnt
$ rsync -avz $(nix-store -qR --include-outputs \
$(readlink /run/booted-system)) root@<newbox>:/mnt/nix/store/~
$ rsync -avz /nix/var/ root@<newbox>:/mnt/nix/var
nix-copy-closure --to root@<newbox> /run/booted-system
Target system doesn’t have nix-store
Here is the sample from Dezgeg:
menuentry "NixOS - Configuration 4 (2017-01-18 - 17.03pre-git)" {
search --set=drive1 --fs-uuid SDA2-UUID
search --set=drive2 --fs-uuid SDA2-UUID
linux ($drive2)/nix/store/vj1wzzwxg3gwfl15kvsd62a41chnhq43-linux-4.9.4/Image.gz systemConfig=/nix/store/mv1pmjzvhfjlw1qn5062nj14h8xqci17-nixos-system-nixos-17.03pre-git init=/nix/store/mv1pmjzvhfjlw1qn5062nj14h8xqci17-nixos-system-nixos-17.03pre-git/init loglevel=4 cma=0M biosdevname=0 net.ifnames=0 console=ttyAMA0
initrd ($drive2)/nix/store/69rnl7i62ss6hwn3pvqcgjmr57kzacnq-initrd/initrd
}
Change SDA2-UUID
to the uuid of /dev/sda2
, which can be found by
finding what links to /dev/sda2
via ls -la /dev/disk/by-uuid
and
place it directly before the ubuntu menuitem
Note that it is worth the time to verify that the paths in that
snippet exist under /mnt
Connect over the SOS console and you’ll be automatically logged in.