User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:howto:omnia_booting_from_external_storage [2018/06/06 11:30]
jschlehofer created
en:howto:omnia_booting_from_external_storage [2018/11/02 15:25] (current)
jschlehofer A few improvements
Line 1: Line 1:
-====== Booting from SSD ======+====== Booting from external and removable storage  ​======
  
-You'll need SSD drive in the correct portserial cable and flashdisk with +For nowthere are two ways, what you can do for booting from external storage.
-medkitConnect serial cable +
  
-===== Creating bootable ​SSD =====+  * The first way is using mSATA SSD, which you need to plug to the right slot, which is close to the heatsink (CPU) as is the only one, which supports also mSATA interface together with mini PCIe. 
 +  * The second way is using the adapter (MPCIE1U-NO1) from mini PCIe to USB 2.0, which has to be plugged to the left mini PCIe slot, where is the SIM card slot. Into this adapter, you'll need to plug slim and short USB flash drive, which will fit there.
  
-The safest way to do so is in Omnias rescue rescue modeInstall you SSD inside +For each option, you need to have the serial cable and flash disk with the medkit.  
-your Omnia, connect serial console ​and USB drive with medkit and when powering + 
-it up, try to hit enter repeatedly as fast as you can till you manage to +===== Creating bootable disk ===== 
-interrupt U-Boot bootloader and you get '​=>'​ prompt. Remember how you did it, we + 
-will need it later on again.+Once you have the removable storage inserted to the Turris ​Omnia, ​plug the serial cable and connect ​the power cord. In the serial consolewhen powering it up, try to hit enter repeatedly as fast as you can till you manage to interrupt U-Boot bootloader and you get '​=>'​ prompt. Remember how you did it, we will need it later on again.
  
 In this prompt enter `run rescueboot` and wait for rescue mode to boot up. Once In this prompt enter `run rescueboot` and wait for rescue mode to boot up. Once
-you see the prompt, we can start preparing the SSD. At this moment, you +you see the prompt, we can start preparing the disk. At this moment, you 
-probably have two disk devices available - sda and sdb. Most likely your SSD +probably have two disk devices available - sda and sdb. Most likely your USB/SSD is sda and USB with medkit ​is sdb. You can check it by entering:
-is sda and USB is sdb. You can check by entering ​+
  
 <​code>​ <​code>​
Line 21: Line 20:
 </​code>​ </​code>​
  
-This will show you the size of the drive and partitions available. You can use +This will show you the size of the drive and partitions available. You can use fdisk to repartition your drive if you want to have separate partition dedicated to something else.
-fdisk to repartition your drive if you want to have separate partition +
-dedicated to something else.+
  
 <WRAP center round tip 60%> <WRAP center round tip 60%>
-If you connect a new SSD you need to create partition with tool called **fdisk**.+If you connect a new SSD you need to create ​the partition with tool called **fdisk**.
 </​WRAP>​ </​WRAP>​
  
- +Now format the first partition to Btrfs and create there root subvolume using the following commands:
-Now format the first partition to Btrfs and create there root subvolume using +
-the following commands+
  
 <​code>​ <​code>​
Line 40: Line 35:
 </​code>​ </​code>​
  
-Now you need to mount flashdrive ​and deploy the medkit.+Nowyou need to mount the flash drive and deploy the medkit.
  
 <​code>​ <​code>​
Line 49: Line 44:
 </​code>​ </​code>​
  
-Now is time to clean up everything.+Nowis the time to clean up everything.
  
 <​code>​ <​code>​
Line 57: Line 52:
 </​code>​ </​code>​
  
-Now you have a SSD that you can boot from and you can restart your router+Nowyou have a disk that you can boot fromand you can restart your router ​using these commands.
  
 <​code>​ <​code>​
Line 79: Line 74:
 </​code>​ </​code>​
  
-This changes ​your boot command ​to boot from SSD and saves the setting ​and+These changes ​changed the boot commands ​to boot from SSD, saved the settings, ​and
 actually boots your router. Next time you reset it, it should boot actually boots your router. Next time you reset it, it should boot
 automatically from SSD. automatically from SSD.
 +
 +==== Booting from USB ====
 +
 +To boot from USB flash drive prepared in previous step, you need to modify U-Boot
 +environment. To do so you need to get to U-Boot prompt again by hitting enter
 +several times early after powering up till you see '​=>'​ prompt. Once you get
 +there, enter the following commands:
 +
 +<​code>​
 +setenv usbboot '​setenv bootargs "​$bootargs cfg80211.freg=$regdomain";​ usb start; btrload usb 0 0x01000000 boot/zImage @; btrload usb 0 0x02000000 boot/dtb @; bootz 0x01000000 - 0x02000000'​
 +setenv bootargs '​earlyprintk console=ttyS0,​115200 rootfstype=btrfs rootwait root=/​dev/​sda1 rootflags=subvol=@,​commit=5 rw'
 +setenv bootcmd 'i2c dev 1; i2c read 0x2a 0x9 1 0x00FFFFF0; setexpr.b rescue *0x00FFFFF0;​ if test $rescue -ge 1; then echo BOOT RESCUE; run rescueboot; else echo BOOT eMMC FS; run usbboot; fi'
 +setenv scsiboot '​setenv bootargs "​$bootargs cfg80211.freg=$regdomain";​ scsi scan; btrload scsi 0:1 0x01000000 boot/zImage @; btrload scsi 0:1 0x02000000 boot/dtb @; bootz 0x01000000 - 0x02000000'​
 +saveenv
 +boot
 +</​code>​
 +
 +These changes changed the boot commands to boot from USB, saved the settings, and
 +actually boots your router. Next time you reset it, it should boot
 +automatically from SSD.
 +
  
 ==== Fixing Schnapps ==== ==== Fixing Schnapps ====
  
-Schanpps ​expects that your root device is on eMMC. To convince it otherwise,+Schnapps ​expects that your root device is on eMMC. To convince it otherwise,
 you need to create configuration file and specify where your rootfs resides: you need to create configuration file and specify where your rootfs resides:
  
 <​code>​ <​code>​
 mkdir /​etc/​schnapps mkdir /​etc/​schnapps
-echo '​ROOT_DEV="/​dev/​sda"'​ > /​etc/​schnapps/​config+echo '​ROOT_DEV="/​dev/​sda1"'​ > /​etc/​schnapps/​config
 </​code>​ </​code>​
  
Line 96: Line 112:
  
 You should avoid using LuCI mount plugin as it tries to unmount all external You should avoid using LuCI mount plugin as it tries to unmount all external
-drives including your SSD and that would break your system till the reset. Also+drives including your disk and that would break your system till the reset. Also,
 there is a possibility that at some point we will update U-Boot and it's there is a possibility that at some point we will update U-Boot and it's
 environment in one of our future releases and this might override your setup environment in one of our future releases and this might override your setup
-and you would need to repeat step 'Booting from SSD' ​to get your router +and you would need to repeat step [[en:​howto:​omnia_booting_from_external_storage#​booting_from_ssd|Booting from SSD]] or [[en:​howto:​omnia_booting_from_external_storage#​booting_from_usb|Booting from USB]] to get your router 
-booting again. Also most of the recovery options using the reset button will+booting again. Alsomost of the recovery options using the reset button will
 not work - reverting to the previous snapshot or factory reset. You can still not work - reverting to the previous snapshot or factory reset. You can still
 manage your snapshots manually using schnapps if you set it up correctly. manage your snapshots manually using schnapps if you set it up correctly.