Copy of raspi 3 JeOS SD-card not booting, directories missing

Hi
Here are mine for USB, blkid output will give you what you need for your sd card device;


blkid

/dev/sda1: SEC_TYPE="msdos" LABEL="EFI" UUID="2835-4042" TYPE="vfat" PARTUUID="a7d16a20-01"
/dev/sda2: LABEL="ROOT" UUID="e1c89131-e6c3-4ad6-85fa-5fb4fab04c0e" TYPE="ext4" PARTUUID="a7d16a20-02"
/dev/sda3: UUID="0b3ed84e-b817-4f57-b794-dc2df7f93a39" TYPE="swap" PARTUUID="a7d16a20-03"

cat /etc/fstab 

/dev/sda2 / ext4 noatime,nobarrier 1 1
/dev/sda1 /boot/efi vfat defaults 0 0
/dev/sda3 swap swap defaults 0 0

cat /etc/default/grub

GRUB_DISTRIBUTOR=
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_CMDLINE_LINUX=" root=/dev/sda2 disk=/dev/sda quiet splash=silent plymouth.enable=0 swiotlb=512,force cma=384M console=tty0 console=ttyS1,115200n8"
GRUB_TERMINAL=gfxterm
GRUB_GFXMODE=800x600
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
GRUB_BACKGROUND=/boot/grub2/themes/openSUSE/background.png
GRUB_DISABLE_OS_PROBER="true"

Rebuild grub and initrd with;

grub2-mkconfig -o /boot/grub2/grub.cfg
mkinitrd
sync

Two mildly unintelligent questions:

  • Where do I need the output of blkid for editing fstab and grub? I don’t see any UUIDs in these files. Or is it for the /dev/sda1 etc?

  • Can I do this only on a card currently running (especially the grub rebuilt)? I will try it with a card currently not booting (don’t want to loose the functional copy…)

Hi

  1. On the running system. So what is in your fstab and grub files? The UUID is in the blkid output, in my case /dev/sda1 has a UUID of 2835-4042.

  2. Well when grub or the kernel updates, those commands are run as part of the update… so yes it should work on a running system…

If you wanted to do on a running system, then you would need to use a chroot environment just like the instructions in the ‘USB How To’ in the unreviewed FAQ’s forum section… if you where doing it on a RPI, then you would need a USB-microSD dongle to plug it in and work on…

…and in the end it won’t boot. I think I skip this.

I don’t get it, why is it not possible to simply copy a running raspi TW install to another SD-card?

I mentioned elsewhere in another thread,
Don’t use JeOS as the base image before adding a Desktop pattern… unless you understand the ramifications and are comfortable with the result.
JeOS <is> “Just Enough OS” which means that it’s stripped down considerably and won’t provide a solid “normal” base for your operating system… It’s primarily intended for specific purpose systems with limited functionality, not wide-ranging use. If you add a Desktop there will be plenty of missing utilities and base components which would normally be expected.

I instead highly recommend installing the XFCE image, then add your Enlightenment pattern.

TSU

JeOs + Desktop pattern works just fine. With Raspbian as well as with TW.

We are discussing here ways to copy a working SD-card, to have two running systems in the end with identical installs. This works fine with Raspbian but apparently is not possible with TW.

On Thu 01 Feb 2018 04:06:02 PM CST, tsu2 wrote:

suse_rasputin;2853466 Wrote:
> Hi again!
>
> Thanks for the suggestion, do you have any link with what to do
> exactly to “swap back to dev id rather than uuid in both grub and
> fstab”? Then I could try…
>
> I did a fresh install of TW JeOS for raspi 33, but that’s apparently
> unstable after updating to latest version (before drawing in the
> enlightenment pattern):
>
> JeOS after zypper dup errors in console - Install/Boot/Login - openSUSE Forums
>
> and I don’t want the wifi driver included in TW after updating.

I mentioned elsewhere in another thread,
Don’t use JeOS as the base image before adding a Desktop pattern…
unless you understand the ramifications and are comfortable with the
result.
JeOS <is> “Just Enough OS” which means that it’s stripped down
considerably and won’t provide a solid “normal” base for your operating
system… It’s primarily intended for specific purpose systems with
limited functionality, not wide-ranging use. If you add a Desktop there
will be plenty of missing utilities and base components which would
normally be expected.

I instead highly recommend installing the XFCE image, then add your
Enlightenment pattern.

TSU

Hi
I agree… Now that Tumbleweed can boot from USB I just use multiple
ones for different tasks, eg building packages on OBS, one to run
SETI@Home and another soon for flight tracking software if they
build a aarch64 version…

If I want a desktop, then that’s what I would install direct from an
image…

Plus USB devices are a little more robust for plugging/unplugging thatn
the microSD…


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.3|GNOME 3.20.2|4.4.104-39-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Does anybody know why the copy is not bootable, although the UUID in the files match with the output of blkid?

On Fri 02 Feb 2018 09:46:02 AM CST, suse rasputin wrote:

Does anybody know why the copy is not bootable, although the UUID in the
files match with the output of blkid?

Hi
More than likely the hidden bits not copied to the disk sectors…


wipefs -n /dev/sda
DEVICE OFFSET TYPE UUID LABEL
sda    0x1fe  dos

wipefs -n /dev/sda1
DEVICE OFFSET TYPE UUID      LABEL
sda1   0x36   vfat 2835-4042 EFI
sda1   0x0    vfat 2835-4042 EFI
sda1   0x1fe  vfat 2835-4042 EFI

wipefs -n /dev/sda2
DEVICE OFFSET TYPE UUID                                 LABEL
sda2   0x438  ext4 e1c89131-e6c3-4ad6-85fa-5fb4fab04c0e ROOT

wipefs -n /dev/sda3
DEVICE OFFSET TYPE UUID                                 LABEL
sda3   0xff6  swap 0b3ed84e-b817-4f57-b794-dc2df7f93a39

sgdisk -p /dev/sda

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************

Disk /dev/sda: 30965760 sectors, 14.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 25848950-8A65-447A-91ED-9613C0527A9E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 30965726
Partitions will be aligned on 2048-sector boundaries
Total free space is 13544 sectors (6.6 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
1            2048          411651   200.0 MiB   0700  Microsoft basic data
2          413696        29961225   14.1 GiB    8300  Linux filesystem
3        29962240        30957254   485.8 MiB   8200  Linux swap


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.3|GNOME 3.20.2|4.4.104-39-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

I would really love to learn what “hidden bits” are good for and how to copy the complete SD-card to get a running copy.

Any help on that?

Don’t copy using the Windows utility (I can’t state that strongly enough).
Use any *NIX utility, first that comes to mind would be dd.

Otherwise simply install new and copy/replicate your customizations… which would be my personal choice because typically these embedded systems aren’t too complex, especially a relatively new install. If it’s worth the time, script the customizations.

TSU

1.) I did use dd. Didn’t work, as described. Due to “hidden bits”, what ever that is.

2.) Tried to install for last years TW JeOs image. Didn’t work, on update (before installation of desktop) SD-card didn’t come back on reboot.

3.) Installed TW with XFCE. Results in this here:

https://forums.opensuse.org/showthread.php/529598-XFCE-for-Raspi-3-ICMPv6-chatter-on-bridge-interface  

…while my “old” TW JeOs install with Enlightenment desktop from last year works flawlessly.

That’s why I want a COPY of this fully functional SD-card.

Which is apparently not possible.

Hi
The hidden bits are the bootcode etc, the other changes (which other distros may not use) are to swap from UUID to Device ID.

Boot to your RPI system, login as root and run;


yast disk

Go through and set each partition via selecting eg /dev/mmcblk0pN and select edit in the fstab options select mount by device name rather that UUID.

Check it’s changed via;


cat /etc/fstab

Then edit /etc/default/grub and change the GRUB_CMDLINE_LINUX= to match the relevant /dev/mmcblk0pN rather than UUID.

Once done, rebuild grub;


grub2-mkconfig -o /boot/grub2/grub.cfg

I would reboot the system and make sure all is good.

Pop the modified (from above) source system sd card into a computer and make sure the partitions are unmounted.

Check the device size/geometry (need to compare against target device);


fdisk -l /dev/...
eg, my system it's sdc

fdisk -l /dev/sdc

Disk /dev/sdc: 14.9 GiB, 15931539456 bytes, 31116288 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: 0x45355c7f

Device     Boot    Start      End  Sectors   Size Id Type
/dev/sdc1           2048   411651   409604   200M  c W95 FAT32 (LBA)
/dev/sdc2         413696 30105810 29692115  14.2G 83 Linux
/dev/sdc3       30107648 31116287  1008640 492.5M 83 Linux

Using dd to create the image;


dd if=/dev/sdc of=sdc.img bs=4M iflag=fullblock oflag=direct
sync

Remove the source sd card and put in the target card and check size/geometry the same (or bigger should work)

In my case it’s sdc again, no partitions etc, but set to dos;


fdisk -l /dev/sdc
Disk /dev/sdc: 14.9 GiB, 15931539456 bytes, 31116288 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: 0xae420040

So the target card is the same (I use SanDisk Ultra 16GB cards for my RPI’s), now can dd the image created onto the target sd card;


dd of=/dev/sdc if=sdc.img bs=4M iflag=fullblock oflag=direct
sync

Put the target sd card into the RPI and it should boot…

My test system was a Leap 42.3 image both the source and target sd cards work fine.

Hi Malcom!

Thank you very much for the detailed post, highly appreciated (got DDOSed from the from for some days, again after the December incident with the “Browser FOSS privacy” thread, now I back :slight_smile: ).

I would prefer not to test this on my only running TW for Raspi 3 that has no IPv6 dhcp on the network bridge, as described in this thread:

https://forums.opensuse.org/showthread.php/529598-XFCE-for-Raspi-3-ICMPv6-chatter-on-bridge-interface

but will test it instead first with a fresh install of TW for Raspi 3. Will come back later to report!