Tilaa is my vps provider but doesn't have alpine in the install options After playing around with the vps systems... coreos ubuntu.. i did make mistakes... coreos got invaded ... opened a webgui... forgot to protect it... needed to get some data from it. So used the Tilaa rescue boot (in the Dashboard) and mounted the disks. Also used it when i increased the disk size for an installation (if I remember correctly), deleting the partition, creating a new one with the same starting address), do a resize2fs to expand and voila.. Bob was my uncle.
After playing arround with Alpine Linux in coreos and ubuntu lxd. I thought it would be a nice distro to get running straight from the vps. A weekend without sunlight but with pixellight I got it running, needs another iteration to make it a smooth experiance :o.
DISCLAIMER Any action you take upon the information on this page is strictly at your own risk, I won't be liable for any losses and damages in connection with the use of this page.
Install Arch linux
Boot rescue
Open video display
Optional startx
but is handy.. to copy urls etc.
fdisk /dev/vda
print
d (delete first and only partition)
n (new)
p (primary)
<cr> (partition number 1)
<cr> (default 2048 first sector)
+12G
n (new)
p (primary)
<cr> (partition number 2)
<cr> (first sector, keep default (starts after end 1st partition))
<cr> (last sector, keep default going to the end)
a (bootflag)
2
print
w
Now you should have 2 devices /dev/vda1 (12G) and /dev/vda2 (8G)
mkfs.ext4 /dev/vda1 -L ROOT
mkfs.ext4 /dev/vda2 -L INSTALL
resize2fs /dev/vda1 -s (disables 64bit, syslinux wont work on 64bit, grub will)
mount /dev/vda2 /mnt
browse (in the rescue window) to www.alpinelinux.org get the latest download link (I'm using standard) (check the sha256)
cd /mnt
wget http://dl-cdn.alpinelinux.org/alpine/v3.7/releases/x86_64/alpine-standard-3.7.0-x86_64.iso
wget http://dl-cdn.alpinelinux.org/alpine/v3.7/releases/x86_64/alpine-standard-3.7.0-x86_64.iso.sha256
sha256 -c alpine-standard-3.7.0.x86_64.iso.sha256
should give OK...
mkdir install
mount -o loop <download link here> /mnt/install
cp -R /mnt/install/* .
ls
You've should have apks
boot
efi
, and the install and iso stuff
grub-install --boot-directory=/mnt/boot /dev/vda
No errors?... yeah...
Reboot. (type reboot
on the commandline)
System is going to halt.
Click Start in your Tilaa dashboard.
Wait Till task Open video display' is there. Click it It should have booted in Alpine Linux
root
`
Setup the system. Now it is minimal and root is mounted to tmpfs... Can be used but then you've to use lbu commit after changing anything on the rootfs. Continue by using parts of the guide .. (http://https://wiki.alpinelinux.org/wiki/Native_Harddisk_Install_1.9)
setup-alpine
<cr> (or select what you want)
alpine (hostname that you want)
<cr> (eth0)
<cr> (dhcp)
<cr> (no manual network configuration)
enter a password
again
Europe/Amsterdam (or whatever)
<cr> (no proxy)
<cr> (f find fasted, or what rocks your boot)
<cr> (openssh if nice)
<cr> chrony (works for me)
<cr> (none disk(s))
<cr> (vda2 for config?)
<cr> (defaults for cache is ok)
almost done.
apk update
apk add e2fsprogs e2fsprogs-extra mkinitfs syslinux util-linux
lbu commit (save changes so we can reboot to this point)
Optional? reboot? (setup as system (root mounted on disk not on mem).. read the alpine docs for that -s 0 (no swap)
mount /dev/vda1 /mnt
setup-disk -m sys -s 0 -v /mnt
cd /mnt/boot
mkdir syslinux
mv *.c32 syslinux
mv extlinux.conf syslinux
edit /mnt/boot/syslinux/extlinux.conf
so it looks like below.
TIMEOUT 20
PROMPT 1
DEFAULT hardened
LABEL hardened
MENU LABEL Linux hardened
KERNEL ../vmlinuz-hardened
INITRD ../initramfs-hardened
DEVICETREEDIR /boot/dtbs
APPEND modules=ext4 rootfstype=ext4 root=LABEL=ROOT rw
extlinux --install /mnt/boot/syslinux
type blkid
to see if there is a TYPE="swap"
and LABEL="SWAP"
partition.
edit /mnt/etc/fstab
LABEL=ROOT / ext4 rw,relatime,data=ordered 0 1
LABEL=SWAP none swap defaults 0 0
then do
cat /usr/share/syslinux/mbr.bin > /dev/vda
vingers crossed... and yeah or... go to rescue... and try to fix it.
df -h
should give root mounted on /dev/vda1 (instead of root being mounted on tmpfs)
RESCUE
mount /dev/vda2 /mntroot
grub-install --boot-directory /mnt/boot
END RESCUE
Delete install partition and resize fs. Use the fdisk from util-linux package, it gets the start sector right (no puzzle for you)... Do not remove signature if asked.
fdisk /dev/vda
d (delete)
2 (partition 2)
d (delete)
n (new)
p (primary)
<cr> (partition number 1)
<cr> (default start (2048), MUST be the same as the partition 1 you've deleted. Do not write (w) if you'r not sure)
<cr> (default end)
N (do not remove signature, if asked)
a (make sure the one partition has a boot flag
w (write)
resize2fs /dev/vda1
that should be it.
df -h
shows 19.6G
Did not test this, but should work (source: https://wiki.alpinelinux.org/wiki/Setting_up_disks_manually). Do
rc-service swap start
to start swappingfree -m
will show how much swap space is available (in MB).
It works... yeah
Create snapshot now. This makes future endeavors easy.
Hi, I has the similar vps as yours, but I dont have the rescue mode to enter, only ssh and re-install option. Recently, I make a script that looks like everything works fine, but after reboot twice, the system cannot be ssh. Not sure, if u meet such as problem and has a solution.
The script can be directly run under the original debian system and replace the
debian
withalpine linux 3.19
.