[SOLVED] - Extroot - (expanding Turris package space)

The other way is to configure extroot as you would normally do, but add this start script to the extroot system:

cat <<EOF > /etc/rc.d/S01mount-rom
/usr/bin/mount -o remount,rw /rom
/usr/bin/mount --bind /rom/boot /boot
/usr/bin/mount --bind /rom/lib/modules /lib/modules
/usr/bin/mount --bind /rom/etc/modules.d /etc/modules.d
/usr/bin/mount --bind /rom/etc/modules-boot.d /etc/modules-boot.d
EOF

chmod +x /etc/rc.d/S01mount-rom

This will make to mount bind all kernel related folders very early, so extroot system will always update kernel and modules on mmc.

I have a few questions.
Because I have no guarantee that some of software running on omnia writes to mmc (lxc containers are on mSATA, but there is more software installed, some of them may not use only /tmp and /var), I consider moving entirely to mSATA in your way.

So:

  1. how to change this u-boot variable?
  2. can it be /dev/sda1?
  3. I have no subvolumes, I assume it is necessery to create one.
  4. how to copy entire filesystem to mSATA? rsync?

Thanks in advance.

fw_printenv shows it and fw_saveenv allows changes. Be sure to have a backup of /dev/mtd0. Alternative approach: clearenv to remove automatically generated variables, loadenv to get the ones from flash, setenv to change them and saveenv to save them back and reboot to try it in u-boot will do the same thing.

  1. This should work but with will require some changes to the variables.

  2. There is always a toplevel subvolume with id 5. If you donā€™t give one then it should work. On the other hand creating a subvolume is simple and gives the option to switch the used subvolume with the change of one variable, holding the reset key or even using a switch on the extension header (to be implemented later). I saved the subvolume name to one variable in u-boot and only have to change it in the boot prompt to switch to a backup snapshot.

  3. btrfs-send ... | btrfs-receive ... may be a better option. This does not only copy data and permissions but also internal attributes like no-cow and compressed and part of its metadata like data-dedup.

2 Likes

Hi,

very inspiring thread. Could you be more specific for us - n00bish - users please? :slight_smile: or you would not recommend it at all ?

For example I have trouble with very first command - fw_printenv - I got response:

Cannot parse config file: No such file or directory

It is specially a bit cryptic to not have some n00bish user do it without thinking about the consequences and risks.

Some for reference:

  • wrong or missing bootloader settings (fixable with the internal serial port)
  • killed bootloader (may require JTAG)
  • even worse thingsā€¦

It seems /etc/fw_env.config is missing.

WIthout any warranty: Content of /etc/fw_enc.config

I donā€™t know if the mtd is correct for TurrisOS. The flash sector size may also be different. Be sure to have backups of the mtd device and the environment after reading works. You will need them on another device if something goes wrong.

It should probably have this content:

/dev/mtd0 0xC0000 0x10000 0x10000

Thanks, Iā€™ll probably let it go for now (I wanted to use sata ssd instead of flash safest possible way - with working updates) but Iā€™m not experienced enough for it.

I thought fw_* was ā€œofficialā€ or working by default but it doesnā€™t seem so.

when creating /etc/fw_env.config with values you provided I just got:

Warning: Bad CRC, using default environment
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200

so I donā€™t think it would be wise to proceed any further - I would be just ā€œspammingā€ you or someone else after each step

Most of things i do are far of from ā€œofficialā€ or even simple. I try to keep things safe most of the time but bad things happen quite often.

thats ok when you know what to do :slight_smile: but why thereā€™s uboot-envutils package installed but no /etc/fw_env.config - itā€™s bug or ā€œfeatureā€?

A month back i bought a Khadas VIM2 MAX as i was looking for a SoC that could decode x265 for KODI. They have a AWESOME feature.

As it has the ability to run dual-OS from eMMC, it also gives the possibility to run even a triple OS using a SDCard. Here they have a feature that if a Micro-sdcard is plugged in that contains a OS, it will automatically boot from that micro-sdcard. So why is this a awesome feature? Well the wear leveling can sooner or later be a fact on the eMMC. It could be 10 yearsā€¦20 yearsā€¦i do not know. However many of us havenā€™t bought the Turris Omnia for 2-3 years, rather a investment for the future (replacing wifi cards, Antennaā€™s, SSD-drive, USB dongles/drives, etcā€¦). When the eMMC of the Omnia has left us, logically thinking it would mean the Omnia is ready for the junkyard right? Or used as a simple hub as the switch functionality wouldnā€™t even work as there is no software controlling it. So having the ability to put the WHOLE Turris OS on a SSD-drive would be a good alternative right?

Do correct me if i have said something incorrectly or give your additions to what i have come up with.

http://docs.khadas.com/bootcamp/BootingCardVsBurningCard/

2 Likes

So I come back to playing with Omnia and what do I see? This is now officially supported! \o/

If youā€™ve ended up here because this is top search result when looking how to set up the router from external drive, you need to fetch the medkit and follow the official documentation. Still, there are two things Iā€™d like to mention.

UUID

First of, it is possible to use UUIDs instead of device names (which are not stable and change based on what drives are attached to the router). To do this, run fdisk -l /dev/sda and take note of the ā€˜Disk identifierā€™.

# fdisk -l /dev/sda
Disk /dev/sda: 55.9 GiB, 60022480896 bytes, 117231408 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe17eb372

Device     Boot Start       End   Sectors  Size Id Type
/dev/sda1        2048 117231407 117229360 55.9G 83 Linux

In the listing above, the id weā€™re after is e17eb372 (note 0x prefix is stripped). Now, when changing bootargs (as documented), use root=PARTUUID=e17eb372-01 instead of root=/dev/sda1 (where e17eb372 is the identifier of your disk).

/var

Second of, one of the reasons I wanted to use external disk is so that I can persist all the data. For example all the log files saved to /var/log. To achieve that, Iā€™ve figured Iā€™ll modify the root file system by dropping the /var symbolic link (which points to /tmp) and make it into a directory (i.e. rm /mnt/ssd/@/var; mkdir /mnt/ssd/@/var). Unfortunately, after that change, the router no longer boots and hands after printing procd: - ubus -.

Anyone has any ideas how this can be addressed? Or do I need to manually configure everything I want to write data someplace outside of /var?

1 Like