Install new OS without USB Adapter for eMMC Module?
#1
Hello, I'm sorry for being dummy. Do I understand correctly that I need the USB Adapter for eMMC Module to install other OS on Pinebook Pro? 
There are some issues with the default Debian - the problem with the sleeping mode and bluetooth devices, so I decided to try sort of more
user-friendly Bionic. 

It also overheats during long compilation and freezes, but this is not exactly an OS issue.
#2
If the flavor you want to put on emmc is currently booted from sdcard then take a look at this thread, specifically post#7. Just replace the debian image with the one of your choice. I've done this multiple times without error but to be clear I was only restoring the stock Debian back to the Emmc.

https://forum.pine64.org/showthread.php?tid=8229
#3
(02-21-2020, 03:30 AM)leonidas Wrote: Hello, I'm sorry for being dummy. Do I understand correctly that I need the USB Adapter for eMMC Module to install other OS on Pinebook Pro? 
There are some issues with the default Debian - the problem with the sleeping mode and bluetooth devices, so I decided to try sort of more
user-friendly Bionic. 

It also overheats during long compilation and freezes, but this is not exactly an OS issue.

Hi.

You don't need an USB adapter to flash the emmc.

You can boot the PBP with a micro SD card, use it like normal and also download and write an image to the emmc from the sd card.

Steps:
- download an image and write it to a micro sd card
- start the PBP with the sd card
- then download the image of your choice
- write the image to the emmc card with the command dd


So basically you are writing from sd card to emmc.
There is a section in the general wiki that gives helpful instructions.

NOTE: Before you write an image to the emmc I would recommend to try it from the SD card first. That way you can also try different distros before you decide what to put on the emmc.
#4
For what it's worth, these instructions did not work for me. The only way I was ever able to boot into the micro SD card was to first boot into the OS on the eMMC, then do `sudo reboot`. Removing the eMMC and then trying to boot into SD, does *not work*.
#5
There is something wrong with the 1st 16M on your emmc
With a bootable uSD, it should "just boot" it (with mrfixits' stock debian,,1st 16M)
So, as I had to advise my son, like so
(and I am assuming that you know how to use dd)
Boot uSD, recent stock(mrfixit),, whether anything on emmc is mounted, doesn't matter
save emmc mbr (bs=512 count=1 of=emmc.mbr,,, some current directory on SD)
write 16M from SD to emmc (bs=1M count=16)
restore emmc mbr (if=emmc.mbr of=emmc,,, since only 512Bytes no count or bs needed)
--edit-- please note that Auyfans' images prioritize the emmc over SD,,
you may wish to do this for them too
--edit-- actually the SD does not need to be booted, just available, any boot will do,
but often the emmc is screwed up, the 1st 16M could be pulled off a suitable usb
(stock image dd'd to a usb stick)
#6
Well the day has come and its time to restore my emmc with default Mr Fixit's Debian.

Although I have read with interest over the last several weeks the various posts in this forum regarding restoring the default Debian after an "event" has created a problem with their emmc I must confess I'm not sure the present state of affairs.

Can someone verify/clarify?

1. Is it safe and likely to succeed (without breaking the boot sector of the emmc) to use the following method to restore the default Debian to one's emmc? (Success defined as the resulting PBP restored to default Debian still with the ability to boot from an SD card if one is present .)

-- Quote from Surehand53 above:

"Steps:
- download an image and write it to a micro sd card
- start the PBP with the sd card
- then download the image of your choice
- write the image to the emmc card with the command dd"

---------------------------------------------------------------------

with example DD command:

where mmcblk1 is the target emmc

dd if=pinebookpro-debian-desktop-mrfixit-191123.img of=/dev/mmcblk1 status=progress

or if not

2. Is there a modification or finessing of the above technique that makes it more reliable/foolproof?

 or if not

3. Should one just punt and start with using the method that requires one to obtain an emmc to usb/usd adapter discussed in various posts?

or something else?

Hope someone can weigh in with the definitive answer on this.  Thanks.
#7
That looks right to me but I'm no authority.  I don't get why your SD doesn't boot, mine does.  I tried the Debian Bullseye debootstrap on the SD and it booted and ran.  Then there was a problem with the files it uses preventing it from working again.

Use a bs=1M in your dd line, it'll speed it up.

I'd be very nervous about overwriting the only thing that boots, in fact I think the OS won't let you do that.  Don''t know if you have spare SDs or a reader and space on another machine, but you could back up your eMMC first.  While booted from the eMMC be sure the SD is mounted and formatted.  Then do a dd of the eMMC (both partitions at once like /dev/mmcblk1) to a new file on the SD, use an img extension.  When that's done shut down and take it out, set it aside if you have spares or move the file off onto some other machine if not.  

You might be able to just clone your eMMC onto the SD with dd, then after you see that it can boot copy your new image onto it as a file.  Boot from the SD and dd the image to the eMMC.  Shut down, take out the SD, it should now boot from the new image on the eMMC.  It's better if you have a backup so you can restore your original eMMC if needed.  Or you could write the new image to the SD, test that it boots, and dd it to the eMMC.  Maybe.  I think you can't overwrite your boot drive, you need to be booted from the SD to overwrite the eMMC.

I have a new SSD sitting here, I'm waiting for the adapter, then I'll be doing something similar.
#8
(03-04-2020, 09:50 PM)ab1jx Wrote: That looks right to me but I'm no authority.  I don't get why your SD doesn't boot, mine does.  I tried the Debian Bullseye debootstrap on the SD and it booted and ran.  Then there was a problem with the files it uses preventing it from working again.

Use a bs=1M in your dd line, it'll speed it up.

I'd be very nervous about overwriting the only thing that boots, in fact I think the OS won't let you do that.  Don''t know if you have spare SDs or a reader and space on another machine, but you could back up your eMMC first.  While booted from the eMMC be sure the SD is mounted and formatted.  Then do a dd of the eMMC (both partitions at once like /dev/mmcblk1) to a new file on the SD, use an img extension.  When that's done shut down and take it out, set it aside if you have spares or move the file off onto some other machine if not.  

You might be able to just clone your eMMC onto the SD with dd, then after you see that it can boot copy your new image onto it as a file.  Boot from the SD and dd the image to the eMMC.  Shut down, take out the SD, it should now boot from the new image on the eMMC.  It's better if you have a backup so you can restore your original eMMC if needed.  Or you could write the new image to the SD, test that it boots, and dd it to the eMMC.  Maybe.  I think you can't overwrite your boot drive, you need to be booted from the SD to overwrite the eMMC.

I have a new SSD sitting here, I'm waiting for the adapter, then I'll be doing something similar.
----------------------------------------------------------------------------------

ab1jx, thank you for your thoughts and suggestions.

I take to heart your advice to clone/backup the emmc before proceeding.

I will do just that before I go further.

My situation is not dire at this point as my PBP still boots from both the emmc or the SD card when present but the default Debian system has developed enough problems I'd like to refresh it.

I should have (as you are recommending) cloned it in the past so it could have been simply restored to the original state but unfortunately I did not.

Now I'd like to do a fresh install of Debian to the emmc but not lose the ability to boot from an SD card which from various accounts appears to be
a risk when DD'ing to the emmc. However I don't have a good sense of what the level of risk is or the best way to mitigate such risk.

Therefore I wanted to get feedback from others on the best way to proceed.

Like you I have an SSD and plan to install it when the time presents itself.

Thank you again for your advice.
#9
Because of /dev, /sys, /proc, /run cloning a booted system is not a good idea, better use rsync
When not booted, these are empty directories

mount |grep mmc (make sure no partitions on emmc are mounted)
Maybe blank 1st 16M,,,, dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=16
bs=1M, faster,,but the real point is default block size of dd 512 bytes is slower than slow
REALLY slow,, this only shows up writing several MB, you are writing 5G
Otherwise your command line looks good
I think an install resizes,, check (df) ,,if not, cfdisk (expand) and resize2fs on unmounted partition
(booted from SD), then fsck.ext4 to make sure all is well (df -h 58G)
--edit--
a little more elegant
xzcat pinebookpro-debian-desktop-mrfixit-191123.img,xz|dd of=/dev/mmcblk1 bs=1M status=progress
there is an image 1 month newer BTW,, pinebookpro-debian-desktop-mrfixit191226.img.xz
#10
(03-04-2020, 11:17 PM)wdt Wrote: Because of /dev, /sys, /proc, /run cloning a booted system is not a good idea, better use rsync
When not booted, these are empty directories

mount |grep mmc (make sure no partitions on emmc are mounted)
Maybe blank 1st 16M,,,, dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=16
bs=1M, faster,,but the real point is default block size of dd 512 bytes is slower than slow
REALLY slow,, this only shows up writing several MB, you are writing 5G
Otherwise your command line looks good
I think an install resizes,, check (df) ,,if not, cfdisk (expand) and resize2fs on unmounted partition
(booted from SD), then fsck.ext4 to make sure all is well (df -h 58G)
--edit--
a little more elegant
xzcat pinebookpro-debian-desktop-mrfixit-191123.img,xz|dd of=/dev/mmcblk1 bs=1M status=progress
there is an image 1 month newer BTW,, pinebookpro-debian-desktop-mrfixit191226.img.xz
---------------------------------------------------------------------------------------------
Thank you, WDT

Appreciates the good points, insights and suggestions particularly pertaining to disk checking. Never hurts to go the extra mile/km.

Good catch regarding the newer 191226 image.

Marshalling the courage. Thanks again.


Possibly Related Threads…
Thread Author Replies Views Last Post
  U-Boot with direct NVMe boot support for eMMC/SPI Flash pcm720 120 109,931 09-11-2021, 02:16 PM
Last Post: calinb
  Pinebook Pro not powering on when eMMC hardware switch is off vgrimaldi 2 423 06-29-2021, 05:19 AM
Last Post: KC9UDX
  UK Pinebook Pro for sale (UK buyers only, 64GB, eMMC reader, NVME add-on) Z0rua 0 458 06-01-2021, 12:51 PM
Last Post: Z0rua
  I am ready to accept that there may be a problem with my emmc. djhnsn 4 1,020 05-18-2021, 12:25 AM
Last Post: djhnsn
  Wiped EMMC, forgot do write new image, won't recognize EMMC zeno 4 927 05-11-2021, 01:53 PM
Last Post: wdt
  Need Advice for Wiping eMMC on Dead LCD Pinebook Pro calinb 9 1,672 05-10-2021, 12:49 PM
Last Post: calinb
  eMMC not gets detected by initramfs? overlisted 6 2,224 05-09-2021, 09:08 PM
Last Post: djhnsn
  Happy eMMC and SDcard OS usage for Pinebook Pro Newbies... Paulie420 40 23,658 02-27-2021, 11:01 AM
Last Post: wdt
  microsoft teams install problem jip 3 1,106 02-17-2021, 09:27 AM
Last Post: pagesix1536
  Pinebook Pro 128GB EMMC for sale **sold** dgkPBP 7 2,301 01-15-2021, 08:48 AM
Last Post: dgkPBP

Forum Jump:


Users browsing this thread: 1 Guest(s)