make pi3 boot from sd but point to the main system on usb

Ask questions about Arch Linux ARM. Please search before making a new topic.

make pi3 boot from sd but point to the main system on usb

Postby LinuxFanBoy » Tue Mar 29, 2016 10:49 am

hi! i want my pi3 boot from the micro sd but point to the main os on the usb. any good ideas how to achieve this?
thanks in advance
LinuxFanBoy
 
Posts: 2
Joined: Tue Mar 29, 2016 10:39 am

Re: make pi3 boot from sd but point to the main system on us

Postby WarheadsSE » Tue Mar 29, 2016 1:40 pm

Exactly the same way as any Pi.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: make pi3 boot from sd but point to the main system on us

Postby syg00 » Fri Apr 01, 2016 1:01 am

A quick search should give you some hints. Actually I'm surprised it's not in the guides - :doh: just noticed one.
tl:dr - copy the root, fix fstab, fix /boot/cmdline.txt, reboot

I had an issue with power drops messing with journald, so had to clean up /var - decided to move it to USB as it probably has most of the I/O. Simple and similar process.
Yes, now behind UPS.
Last edited by syg00 on Sun Apr 03, 2016 2:34 am, edited 1 time in total.
syg00
 
Posts: 15
Joined: Sat Mar 12, 2016 1:30 am

Re: make pi3 boot from sd but point to the main system on us

Postby Gwildor » Fri Apr 01, 2016 3:15 pm

I did this once only to learn that the performance went down the drain. Also, because the usb key required too much power, I had permanent undervoltage warning and fs corruption on the usb key.
Gwildor
 
Posts: 5
Joined: Fri Apr 01, 2016 2:46 pm

Re: make pi3 boot from sd but point to the main system on us

Postby salafrance » Fri Apr 08, 2016 1:20 pm

I set up one of my Pies as a file server. Filesystems which needed persistence were given to an external, powered, 5.25" drive. Non-persistent filesystems were handed to tmpfs. Everything else was set read-only.

The /boot/cmdline.txt file:
$this->bbcode_second_pass_code('', '
ariane@hermod ~ $ cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
ariane@hermod ~ $
')

The /etc/fstab file:

$this->bbcode_second_pass_code('', '
######################################################################################################
# a swapfile is not a swap partition, so no using swapon|off from here on, use dphys-swapfile swap[on|off] for that
######################################################################################################

proc /proc proc defaults 0 0
tmpfs /tmp tmpfs nodev,nosuid,size=32M,mode=1777 0 0
tmpfs /var/log tmpfs nodev,nosuid,size=32M,mode=1777 0 0
UUID=e7092694-21b1-4758-b15f-a78bfc0d5b6f /var ext4 defaults,noatime 0 3
/dev/mmcblk0p1 /boot vfat defaults,ro,noatime 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime,ro 0 1

TYPE=swap none swap pri=100 0 0
UUID=9a65d7af-b092-42b8-b126-06432ad52a96 /home ext4 defaults 0 2

UUID=1e99eadb-254e-40de-90d9-c9430eb59933 /media/Elements ext4 defaults 0 4
UUID=98dfc6c9-e4cf-4b81-9bae-05a819dd1d28 /media/Samsung ext4 nosuid,nodev,nofail,auto 0 4
')

Note that I've used device UUIDs to refer to the external drive partitions - this means that I can rely on them being found and mounted correctly regardless of the USB slot into which I plug them.

The swap devices:

$this->bbcode_second_pass_code('', '
ariane@hermod ~ $ swapon -s
Filename Type Size Used Priority
/dev/sdb3 partition 8388604 36 100
/var/swap file 102396 0 -1
ariane@hermod ~ $
')

There are guides which cover this. This system was Raspbian based, but I've made another, Arch-based, Pi read-only as I plan to use it as a Pulse and Bluetooth audio server for other systems. The latter system is much simpler; here's the /boot/cmdline.txt:

$this->bbcode_second_pass_code('', '
[ariane@fafnir qemu]$ cat /boot/cmdline.txt
root=/dev/mmcblk0p2 ro rootwait console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop
[ariane@fafnir qemu]$
')

And here's the /etc/fstab:

$this->bbcode_second_pass_code('', '
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
/dev/mmcblk0p1 /boot vfat defaults,ro,noatime 0 0
tmpfs /var/log tmpfs nodev,nosuid 0 0
tmpfs /var/tmp tmpfs nodev,nosuid 0 0
tmpfs /home/pulse/.config/pulse tmpfs nodev,nosuid,uid=1002,gid=1002 0 0
')
salafrance
 
Posts: 1
Joined: Fri Apr 08, 2016 12:48 pm

Re: make pi3 boot from sd but point to the main system on us

Postby LinuxFanBoy » Fri Apr 29, 2016 10:47 am

yes i see! thank you for your detailed answere :)
LinuxFanBoy
 
Posts: 2
Joined: Tue Mar 29, 2016 10:39 am


Return to User Questions

Who is online

Users browsing this forum: No registered users and 18 guests