Persistent Installation on RPi3

16 posts / 0 new
Last post
#1 Tue, 2017-10-31 16:39
yaron
  • yaron's picture
  • Offline
  • Last seen: 2 months 4 weeks ago
  • Joined: 2017-10-31

Hey guys,

I've seen some attempts to create a persistent (Install to HDD) system and trying them proved me it's might not be the best approach.
At some point I've realized that I need the fat32 partition in order to boot the Raspberry Pi 3.

In order to make the installation persistent I tried running setup-disk -o sys /media/mmcblk0p2, and then changing the cmdline.txt file so it'll have the root=/dev/mmcblk0p2 at the end, it failed miserably, blank screen (I even tried adding rootfstype=ext4
but that didn't help too).

So my question is: Is there a way to create a persistent installation on RPi3?

If that's not possible yet then: Is there a way to keep the python packages I installed with pip using lbu commit?

Tue, 2017-10-31 23:28
ReproducibleBui...
  • ReproducibleBuildsAreAGoodStandard's picture
  • Offline
  • Last seen: 1 month 3 weeks ago
  • Joined: 2017-05-05

Although I haven't installed onto a Raspberry before, could the wiki passage called Persistent storage on Raspberry Pis using disk-based (sys) installation help, even though it is to install onto an SD card?
Could anyone else help please?

Wed, 2017-11-01 08:26 (Reply to #2)
yaron
  • yaron's picture
  • Offline
  • Last seen: 2 months 4 weeks ago
  • Joined: 2017-10-31

Hey there, thank you so much for your help :)

I've tried each and every possible method I could find, this one was the first, apparently changing the cmdline.txt is the problematic part.

I can't help but thinking that maybe the root configuration should not be directly to the device block, I'm guessing there should be another way, I'm reading Kernel loading commands to understand what I did wrong, in the meanwhile I'll be trying some other distros.

Wed, 2017-11-01 22:41
bazooka07
  • bazooka07's picture
  • Offline
  • Last seen: 4 months 1 day ago
  • Joined: 2017-07-07

Get a SD-card and format 2 partitions : First with 128Mo, fat16, boot and lba flags. Second in ext4 with place as you can get.
Download :
http://dl-cdn.alpinelinux.org/alpine/v3.6/releases/armhf/alpine-rpi-3.6.2-armhf.tar.gz
and untar on the first partition.
So plug HDMI, keyboard and network cables. Insert the SD-card into the Raspberrypi and power on.

So launch instructions as follows:

  • setup-alpine ( adjust keymap, timezone, networking. let's say no for save config and cache )
  • mount /dev/mmcblk0p2 /mnt
  • setup-disk -m sys /mnt
  • mount -o remount,rw /dev/mmcblk0p1
  • rm /media/mmcblk0p1/boot/*
  • mv /mnt/boot/* media/mmcblk0p1/boot
  • cd /mnt
  • rm boot/boot
  • rmdir boot
  • mkdir media/mmcblk0p1
  • ln -s media/mmcblk0p1 boot
  • echo "/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0" >> etc/fstab
  • sed -i '/cdrom/d' etc/fstab
  • sed -i '/floppy/d' etc/fstab
  • sed -i '/edge/!s/^#//' etc/apk/repositories
  • cd /media/mmcblk0p1
  • sed -i 's/^/root=\/dev\/mmcblk0p2 /' cmdline.txt
  • reboot

Be patient with setup-disk, especially if you have a RaspberryPi 1B ( several tens of minutes )

After reboot execute the following instructions :

  • rc-update del hwclock boot
  • rc-update add swclock boot
  • rc-update add wpa_supplicant boot ( only if your Raspberrypi has wifi on board )
Wed, 2017-11-01 16:31 (Reply to #4)
yaron
  • yaron's picture
  • Offline
  • Last seen: 2 months 4 weeks ago
  • Joined: 2017-10-31

You are so awesome! Thank you so much!

Is there a chance you will let me add that info to the wiki or add it yourself?

And again, thank you!

Fri, 2017-11-03 00:04 (Reply to #5)
ReproducibleBui...
  • ReproducibleBuildsAreAGoodStandard's picture
  • Offline
  • Last seen: 1 month 3 weeks ago
  • Joined: 2017-05-05

That's great, @bazooka07! Your tips are excellent and wiki-worthy, I agree! It's a great idea by @yaron if you could transcribe your helpful steps into the wiki, or if you would agree for him to have them posted in the wiki! A variation on your steps might possibly be found anyway or modified in the future by anyone who might find any improvements.

Alternatively, if there is no wiki entry made for installation to a hard disk for Raspberry, hopefully someone might provisionally make links in the Raspberry wiki page to your very helpful post above and/or to your French article that was tweeted on November 1st (same user handle, general content and icon). The tweeted link to the article doesn't work but the article was found at Installation de Alpinelinux sur un Raspberry 1B ou 3B instead. Thanks for your input, @bazooka07, that's great!

Fri, 2017-11-03 08:03
Head_on_a_Stick
  • Head_on_a_Stick's picture
  • Offline
  • Last seen: 1 week 1 day ago
  • Joined: 2016-05-01

I've added a new section to the Raspberry Pi page in the wiki with a link to bazooka07's post, I will fill it out a bit more when I have time.

https://wiki.alpinelinux.org/wiki/Raspberry_Pi#Persistent_Installation_on_RPi3

Mon, 2017-11-06 23:22
bazooka07
  • bazooka07's picture
  • Offline
  • Last seen: 4 months 1 day ago
  • Joined: 2017-07-07

Thanks for you remarks.
Now, I have post on Wiki
But, I have to continue for post-installation and install for Nginx.

Tue, 2017-11-07 16:17 (Reply to #8)
yaron
  • yaron's picture
  • Offline
  • Last seen: 2 months 4 weeks ago
  • Joined: 2017-10-31

Just a quick heads up:

Avoid running apk update && apk upgrade with all the repos, the system won't load after this, I tried pulling the logs from the SD Card but I just couldn't find the relevant ones.

Wed, 2017-11-29 03:26 (Reply to #9)
yannssolo
  • yannssolo's picture
  • Offline
  • Last seen: 4 months 2 days ago
  • Joined: 2017-11-18

I have exactly the same problem, all things were fine after a reboot, and then, i did apk-update and apk-upgrade, then i reboot again, and now I have a blank screen, the system does not want to load.
Do you know why there is this error ? How can i load the system now ?
Thanks

Tue, 2017-12-05 10:51 (Reply to #10)
yaron
  • yaron's picture
  • Offline
  • Last seen: 2 months 4 weeks ago
  • Joined: 2017-10-31

@yanssolo, have you tried it with 3.7? You may also want to remove the "edge" repositories.

Wed, 2018-03-21 04:54 (Reply to #11)
herald
  • herald's picture
  • Offline
  • Last seen: 1 week 3 days ago
  • Joined: 2017-11-29

I follow this guide installed the v3.7 got the same problem! RPi 3b can booting but screen dosen't display.

Wed, 2017-11-08 22:57
bazooka07
  • bazooka07's picture
  • Offline
  • Last seen: 4 months 1 day ago
  • Joined: 2017-07-07

Yes, don't select all the repositories but this one nearest from your location or in your country.

To get the list of the repositories :
sudo setup-apkrepos

Avoid to type r (random) of f (fastest), I have a trouble.

Thu, 2017-12-14 16:28
davidfcannock
  • davidfcannock's picture
  • Offline
  • Last seen: 3 months 2 weeks ago
  • Joined: 2017-12-14

Following bazooka's instructions I get a segmentation fault when trying to run setup-disk:

rpi:~# setup-disk -m sys /mnt
^[[3~ERROR: unsatisfiable constraints:
  syslinux (missing):
    required by: world[syslinux]
Installing system on /dev/mmcblk0p2:
sed: /etc/update-extlinux.conf: No such file or directory
/sbin/setup-disk: line 1178: extlinux: not found
 90% ####################################################################################################################             Segmentation fault

I've configured the second partition on my SSD (mmcblk0p2) as ext4. I've tried repeating this process several times. Not sure what the problem is.

Thu, 2017-12-14 17:35 (Reply to #14)
ReproducibleBui...
  • ReproducibleBuildsAreAGoodStandard's picture
  • Offline
  • Last seen: 1 month 3 weeks ago
  • Joined: 2017-05-05

The installation process on Raspberry Pi is slightly modified in the wiki page, which was based on this page, and it has advised since then that syslinux and extlinux errors at that setup point can be ignored. However, I've not installed on a Pi. I'm no expert, but syslinux is the bootloader (a more common bootloader, on other Linux distributions and for x86_64 - not Pi's architecture - is Grub), but Alpine doesn't use that here, I think (and extlinux.conf is roughly equivalent to where on Grub you would modify the 'grub command line', etc).
Can you continue with the wiki instructions? Does anyone know whether the segmentation fault has to do with the hardening of the kernel in this instance?

Sat, 2018-03-24 02:43
jodumont
  • jodumont's picture
  • Offline
  • Last seen: 17 hours 4 min ago
  • Joined: 2018-02-06

@davidfcannock
I also had this error but it's normal and you could continue without fear ;)

@yaron
the most reverent modification on partition 1 I did was
fat16 or fat32
but I did'nt FLAG BOOT and LBA as mentionned

Log in or register to post comments