This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PROCEDURE TO FLASH eMMC
#1
For all the noobs like me I've attached a procedure to flash the 16GB eMMC on the Tinker Board S.  Hope this will be of use.

Rick 
Tongue


Attached Files
.pdf   HOW TO INSTALL AN OPERATING SYSTEM ONTO THE TINKER BOARD S eMMC ROM.pdf (Size: 1.34 MB / Downloads: 1,671)
[-] The following 6 users Like Rjp663's post:
  • astroboboy, Hobissa, Leskriim, Noraxus, Tinker Board, ugur78tr
Reply
#2
Nice

And when you put another os on the eMMC and cant reflash it later.....(been there, had that panic, done that)

https://tinkerboarding.co.uk/wiki/index...._and_Flash
...working my way through the 1000+ ways things don't work to find the one that does...
[-] The following 1 user Likes Robertspark's post:
  • Noraxus
Reply
#3
I "bicked" eMMC of my TBS in the first day of use, today I managed to boot TBS from eMMC for the first time. Here is what I did:

0. Boot your TBS using SD card, use terminal or SSH to input following commands.

1. Download TinkerOS distribution and unzip: 
Code:
wget [link***]
unzip 20180622-tinker-board-linaro-stretch-alip-v2.0.7.img.zip

2. Delete old partitions from eMMC(mmcblk1 in my case):
Code:
sudo fdisk /dev/mmcblk1
d
1
2
w

3. Reboot TBS.

4. Unpack image file to the cleaned partition:
Code:
sudo dd if=20180622-tinker-board-linaro-stretch-alip-v2.0.7.img of=/dev/mmcblc1 status=progress && sync


After this you should be able to boot your TBS form eMMC, do not forget to change jumper to the parking position. Result is not optimal through - root partition on eMMC created by dd tool is only 3GB, rest left not used, I do not know why it happened, and I do not know how to change partition size in fdisk tool, so I used gparted tool to increase root partition on eMMC to use all available space.

I'm complete noob to linux & terminal, so do not blame my solution for the incompetence, on the other hand optimization tips are appreciated.

***P.S. I can not post links, so you have to find workable link for Tinker OS distribution by yourself, I used archive provided on this website wiki section.
[-] The following 1 user Likes mas9l4ever's post:
  • whysguy52
Reply
#4
I've done this way, which is pretty quick.
The only problem is about the partition table which won't be consistent. So it might be better to install only the u-boot image. In such way the previous setup still available to use, and saving time to update the packages that where already done.
First step:
  • Have the previous installation copied onto as SD card, whichever is preferred
  • Boot from SD, following the indication to set the jumper to MASKROM
  • Locate the kernel name of the disk
    Code:
    $ sudo fdisk -l
    For example we assume /dev/mmcblk0 for eMMC and /dev/mmcblk1 for SD card
  • Copy the u-boot from SD card to eMMC
    Code:
    $ sudo dd if=/dev/mmcblk1 of=/dev/mmcblk0 bs=512 seek=64 count=4032 conv=noerror,notrunc

This way will need to write less than 2 Mb, which suffices for most of the cases. Usually the u-boot is not bigger than 460 Kb. Also it prevent to upset the previous partition and they'll come back to be used again. The only advise is to use the same previous installation, whatever is TinkerOS, or Armbian or Volumio or else.
For convenience it might be good to save that portion into SD card, so if it will happen again, is less troubles to resume. Therefore the command become inverted for saving
Code:
$ sudo dd if=/dev/mmcblk0 of=BackupFile.img bs=512 seek=64 count=4032 conv=noerror,notrunc
Then next time BackupFile.img will be used Wink
Reply
#5
(06-23-2018, 01:48 AM)Robertspark Wrote: Nice

And when you put another os on the eMMC and cant reflash it later.....(been there, had that panic, done that)

https://tinkerboarding.co.uk/wiki/index...._and_Flash


Hi,  I've perused the wiki on Recovery and Flash, but the words are jumbled, or else written by someone not very familiar with English.  Can someone translate that?  Thanks,  Joe
Reply
#6
@ Radioman
Can we know were you get difficulties to do the operations.
If your TBS won't be recognized by the PC when is plugged in (some time may take even 15 seconds to react). Then you need to copy the installation file on a SD card, which is already know to boot with TBS in MASKROM mode. After you booted your SD card, just perform the writing to the eMMC (internal memory). Perhaps you may use Etcher from within the SD card installation.

To identify the eMMC against the SD card, you may write a small file onto the SD card and check which partition has it. Later you should find the partition list by
Code:
$ sudo fdisk -l
and to know what is already mounted just do
Code:
$ mount |grep /dev/mmc
So at such point you should recognize which is the device to write the installation, which is by definition the one that has no trailing p[number].

That is for the complete installation recovering, which implies the loss of any previous configuration for a working installation. The other method is referring to recover the UMS functionality which is written on the first 4 Mbytes or less, as above described.
Light blue words might be a link. Have you try to click on them? Big Grin
[-] The following 1 user Likes Im4Tinker's post:
  • Radioman
Reply
#7
(11-01-2018, 07:15 AM)Im4Tinker Wrote: @ Radioman
Can we know were you get difficulties to do the operations.
If your TBS won't be recognized by the PC when is plugged in (some time may take even 15 seconds to react). Then you need to copy the installation file on a SD card, which is already know to boot with TBS in MASKROM mode. After you booted your SD card, just perform the writing to the eMMC (internal memory). Perhaps you may use Etcher from within the SD card installation.

To identify the eMMC against the SD card, you may write a small file onto the SD card and check which partition has it. Later you should find the partition list by
Code:
$ sudo fdisk -l
and to know what is already mounted just do
Code:
$ mount |grep /dev/mmc
So at such point you should recognize which is the device to write the installation, which is by definition the one that has no trailing p[number].

That is for the complete installation recovering, which implies the loss of any previous configuration for a working installation. The other method is referring to recover the UMS functionality which is written on the first 4 Mbytes or less, as above described.

Thanks for your response.  Your posts are always helpful and enlightening.  I'm currently not having difficulties, but really don't care for the Debian based TOS.  I'd like to move to the ELAR Ubuntu/Lubuntu/Xubuntu, and wanted to have all my options ready if I ran into trouble. My RPi3B+ ran on Ubuntu Mate, and I really liked that.  I'm kind of new to the Linux world and find it a breath of fresh air after MS & Mac.  I'm thinking I can overwrite the TOS with the new ELAR OS, is that correct?  Thanks,  Joe  (aka Radioman)
Reply
#8
(11-01-2018, 02:26 PM)Radioman Wrote: I'm thinking I can overwrite the TOS with the new ELAR OS, is that correct?

Yes, you're correct. The variation is to change the content of the second partition, AKA rootfs. But it takes some care that the extlinux.conf in the first partition must point to the rootfs partition. For TinkerOS is omitted, because the u-boot has it set as default. So check carefully the append statement.

If we look at the ELAR partition scheme, we'll find that is the same as linaro one (TinkerOS). The first partition is vfat of few tenth of  Mb, and contains the files for booting, later is mounted on /boot.

If you'll plan such switch, then you need to understand which partition you should copy. That is a bit trickier than simply copy the whole image.
First we need to see the image partition scheme
Code:
$ sudo fdisk -l TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img      ## after unrar-ed
Disk TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img: 2.9 GiB, 3038773248 bytes, 5935104 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: 0x00f43486

Device                                              Boot  Start     End Sectors  Size Id Type
TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img1 *      8192  212991  204800  100M  c W95
TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img2      212992 5935103 5722112  2.7G 83 Linux

$ dmesg |tail                        ## find which is the kernel name when the SD card is plugged in
[ 5850.123697] sd 6:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 5850.124769] sd 6:0:0:0: [sdc] No Caching mode page found
[ 5850.124778] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 5850.130022]  sdc: sdc1 sdc2 sdc3
[ 5850.134126] sd 6:0:0:0: [sdc] Attached SCSI removable disk

$ sudo fdisk -l  /dev/sdc                         ## check the partition scheme
Disk /dev/sdc: 14.6 GiB, 15665725440 bytes, 30597120 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: 0x58bc1052

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sdc1           8192   139263   131072   64M  c W95 FAT32 (LBA)
/dev/sdc2         139264  6283263  6144000    3G 83 Linux
/dev/sdc3       10117120 30597119 20480000  9.8G 83 Linux

Then from those details we'll understand where to start to skip the unnecessary blocks. In particular where the first sector of rootfs starts.
So for the case we may give the command
Code:
$ sudo dd if=TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img of=/dev/sdc bs=512 seek=212992 skip=139264
seek means where to start reading and skip where to start writing.
But it must check that the host partition is big enough 5722112 < 6144000. Later just try it out. Don't try to modify the partition prior a new reboot, because the system needs to expand the partition to the maximum.

A second approach would be to format the linaro rootfs and then write the ElarOS onto the partition.
Code:
$ sudo su                                       ## be a master :-)
# mkfs.ext4 /dev/sdc2                              ## new format
# mkdir /tmp/dest_root                            ## destination mount point
# mkdir /tmp/src_root                               ## source mount point
# mount <path_to_file>/TinkerBoard-Lubuntu18.04LTS_ELAR-Systems-SD-v2.img /tmp/src_root -o loop,offset=104M
# rsync -axHAWXS --numeric-ids --info=progress2 /tmp/src_root /tmp/dest_root
# umount /tmp/dest_root
# umount /tmp/src_root
# e2label /dev/sdc2 <rootfs_partition_name>

Before to start it up, care must be taken to modify the extlinux.conf and set the new rootfs pointer. So  by the help of gparted (the simplest way) set a name to the partitions (unless done). Later browse the plugged TBS and open the extlinux.conf for editing (as administrator), that should reside in the smaller partition.
if there's a statement root=<something> or none, then we need to modify to root=LABEL=<rootfs_partition_name>

A side note, I used to set a second partition for /home, so the system may change but my data won't disappear along the system.
Light blue words might be a link. Have you try to click on them? Big Grin
Reply
#9
Ah so that's why there is some partition table on the internal storage out of the box. This is actually a bootloader that's needed for USB device mode support. Does anybody know how large this bit is so it can be easily backed-up? I think everything after the partition table is already random garbage. Neither of the partitions that are there by default can be mounted (out of the box).
Reply
#10
(11-02-2018, 05:27 AM)Im4Tinker Wrote: [quote="Radioman" pid='8633' dateline='1541082387']
I'm thinking I can overwrite the TOS with the new ELAR OS, is that correct?

So, I got impatient.  I overwrote the TOS on the eMMC with the ELAR.  What harm could I do?   Angry  Yep, I ended up with an eMMC that won't boot.  I quickly flashed the TOS on to my 64GB SD card.  The system is now up and running from that.  Gparted sees the eMMC (shows as un-allocated), but Etcher does not see it, nor does my WIN10 laptop.  I cannot seem to access it.  Is it dead?  Is there any hope?

On an unrelated (sort of) subject, I have a 120GB external SSD that I can see in devices and Gparted, but can't access because it is owned by root.  Root didn't buy the darned thing, I did.  I am so confused.  Where is Ubuntu Mate when I need it?  Thank you for all the help.  This noobie needs it!  Joe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)