Documented by kbruder tech✞ᵀᵀᴹ on Apr 13, 2022
Last updated on Apr 15, 2022
Whether you are running your platform using LCMS in the cloud, in your office or at home, it's always a good idea to have a bare-metal alternative in case of "outages". I always thought it was a good use case to use LCMS in a local network setting with friends and family. The BPI-W2 boasts a quad core processor and 2GB of RAM, so supporting a few dozen concurrent users should be no problem for this little guy. The best part is that it only takes a small router configuration change and a domain name configuration to make your little LCMS box available on the internet.
This prototype will actually be hosting the live lookaway.info site (this site), from an undisclosed location of course. Hopefully this will suffice as a proof of concept in order to generate interest in the project and possibly get backing to assemble some more prototypes.
1x BPI-W2 Single Board Computer
1x 64GB MicroSD card
1x BPI 12V Power Adapter
2x Samsung 1TB SSD SATA III
2X 23 pin SATA Extension Cable
1x BPI-W2 Case
1x Pack of Assorted Adhesive Heatsinks
Download a supported Ubuntu Server image, format the SD card to FAT32 then write the image to the SD card. Once that is complete, insert the card into the SD card reader on the BPI-W2, attach the ethernet to your network, set SW4 to 1 (to boot from the SD reader), then plug in the power. The BPI-W2 will take a minute or two to boot. Once you can see the device on your network, use a remote terminal to log into the BPI-W2.
BPI-W2 Linux Images - Google Drive
Download an image file that will run on your BPI-W2.
SD Memory Card Formatter for Windows Download | SD Association
Download this utility to format your SD card.
Win32 Disk Imager download | SourceForge.net
Download Win32 Disk Imager for free. A Windows tool for writing images to USB sticks or SD/CF cards . This program is designed to write a raw disk image to a removable device or backup a removable device to a raw image file. It is very useful for embedded development, namely Arm…
Learn how to deploy Lookaway CMS onto a public webserver using Ubuntu 20.04 and PostgreSQL 10.
Format the disks, setup the RAID mirror, then create the file system.
pi@lookaway:~$ sudo fdisk /dev/sataa
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-1953525167, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-1953525167, default 1953525167):
Created a new partition 1 of type 'Linux' and of size 931.5 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
pi@lookaway:~$ sudo fdisk /dev/satab
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xa0ba1853.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-1953525167, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-1953525167, default 1953525167):
Created a new partition 1 of type 'Linux' and of size 931.5 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
pi@lookaway:~$ sudo mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sataa /dev/satab
mdadm: partition table exists on /dev/sataa
mdadm: partition table exists on /dev/sataa but will be lost or
meaningless after creating array
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
mdadm: partition table exists on /dev/satab
mdadm: partition table exists on /dev/satab but will be lost or
meaningless after creating array
Continue creating array? yes
mdadm: Fail create md0 when using /sys/module/md_mod/parameters/new_array
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
pi@lookaway:~$ ls /dev/md0
/dev/md0
pi@lookaway:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 48.5M 1 loop /snap/core18/1883
loop1 7:1 0 49M 1 loop /snap/core18/2349
loop2 7:2 0 57.5M 1 loop /snap/core20/1408
loop3 7:3 0 63.6M 1 loop /snap/lxd/16103
loop4 7:4 0 61M 1 loop /snap/lxd/22761
loop5 7:5 0 37.8M 1 loop /snap/snapd/15183
sataa 8:0 0 931.5G 0 disk
└─md0 9:0 0 931.4G 0 raid1
satab 8:16 0 931.5G 0 disk
└─md0 9:0 0 931.4G 0 raid1
mmcblk1 179:0 0 7.3G 0 disk
└─mmcblk1p1 179:1 0 16M 0 part
mmcblk1boot0 179:8 0 4M 1 disk
mmcblk1boot1 179:16 0 4M 1 disk
mmcblk1rpmb 179:24 0 512K 0 disk
mmcblk0 179:32 0 59.5G 0 disk
├─mmcblk0p1 179:33 0 256M 0 part /boot/firmware
└─mmcblk0p2 179:34 0 59.1G 0 part /
pi@lookaway:~$ sudo mkfs.ext4 /dev/md0
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done
Creating filesystem with 244157616 4k blocks and 61046784 inodes
Filesystem UUID: e9d6ae08-af59-4ce4-b5d4-47c3901b06d3
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
pi@lookaway:~$ sudo blkid
...
/dev/md0: UUID="e9d6ae08-af59-4ce4-b5d4-47c3901b06d3" TYPE="ext4"
I have not been able to get my mdadm device to persist after reboot. These are the commands I am currently using after each reboot.
$ sudo mdadm --assemble --scan
$ sudo mount /dev/md/0 /home/lookaway/lookaway-env/lookaway/media
This document explains how to recover your Lookaway CMS powered website from backup data.
DOCUMENTATION IN PROGRESS...