Moximo Project Notes

SOC

Currently using cubietruck but can use any hardware that can run Linux (arm and intel).

Operating System

Boot from the SD card, root filesystem in the SSD.

Setup

Initial image in the SD card have to transfer the root fs to the SSD.
Check the SSD

[root@moximo ~]# fdisk -l
Disco /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 sectores
Unidades: sectores de 1 * 512 = 512 bytes
Tamaño de sector (lógico/físico): 512 bytes / 512 bytes
Tamaño de E/S (mínimo/óptimo): 512 bytes / 512 bytes
Tipo de etiqueta de disco: dos
Identificador del disco: 0x3ddfbd89

Disposit.      Inicio Comienzo    Final Sectores Tamaño Id Tipo
/dev/mmcblk0p1            2048  1001471   999424   488M 83 Linux
/dev/mmcblk0p2         1001472  2001953  1000482 488.5M 83 Linux
/dev/mmcblk0p3         2001954 30391376 28389423  13.6G 83 Linux


Disco /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectores
Unidades: sectores de 1 * 512 = 512 bytes
Tamaño de sector (lógico/físico): 512 bytes / 512 bytes
Tamaño de E/S (mínimo/óptimo): 512 bytes / 512 bytes
Tipo de etiqueta de disco: dos
Identificador del disco: 0x00000000

Disposit.  Inicio Comienzo     Final  Sectores Tamaño Id Tipo
/dev/sda1               63   3903794   3903732   1.9G 82 Linux swap / Solaris
/dev/sda2  *       3903795  42973874  39070080  18.6G 83 Linux
/dev/sda3         42973875 468862127 425888253 203.1G 83 Linux

If partitions dont exist create them with sfdisk using this layout.

[root@moximo ~]# more moximo-fs.layout 
label: dos
label-id: 0x00000000
device: /dev/sda
unit: sectors

/dev/sda1 : start=          63, size=     3903732, type=82
/dev/sda2 : start=     3903795, size=    39070080, type=83, bootable
/dev/sda3 : start=    42973875, size=   425888253, type=83


Create the partitions:

[root@moximo ~]# sfdisk /dev/sda < my.layout 

If needed increment the size of /dev/sda3 using cfdisk.

/dev/sda2 should be the root filesystem, format it with ext4

[root@moximo ~]# mkfs.ext4 /dev/sda2
mke2fs 1.42.13 (17-May-2015)
/dev/sda2 contains a ext4 file system
        created on Sun Oct  2 15:52:41 2016
Proceed anyway? (y,n) y
Discarding device blocks: done                            
Creating filesystem with 4883760 4k blocks and 1221600 inodes
Filesystem UUID: 64943547-5893-4a49-905a-204ebc163ec4
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

/dev/sda3 should be the /var filesystem, format it with xfs (bigger hard link size for overlay docker storage driver)

[root@moximo ~]# mkfs.xfs -f /dev/sda3
meta-data=/dev/sda3              isize=512    agcount=4, agsize=13309008 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=0
data     =                       bsize=4096   blocks=53236031, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=25994, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

NOTE: make shure the ftype setting is set to 1

Create a tar file for the root filesystem
Create the file and unpack it on the proper partitions

[root@moximo ~]# cd /
[root@moximo /]# mount /dev/sda2 /mnt
[root@moximo /]# mkdir /mnt/var
[root@moximo /]# mount /dev/sda3 /mnt/var
[root@moximo ~]# tar -c * > /mnt/var/moximo-sd-fs.tar --exclude=var/lib/docker --exclude=/mnt/var/moximo-sd-fs.tar
[root@moximo /]# cd /mnt
[root@moximo /mnt]# tar -xf /mnt/var/moximo-sd-fs.tar

Clone the moximo repo




Set hostname systemd way

hostnamectl set-hostname