Jump to content

nand-sata-install script


zonegrise

Recommended Posts

I retried my test.

I runned nand-sata-install script and didn't reboot after the transfer of files is complete.

The output of the following command "sudo lsblk -o name,mountpoint,size,type,ro,label,uuid" is :


NAME         MOUNTPOINT  SIZE TYPE RO LABEL  UUID
sda                     55.9G disk  0
└─sda1                  55.9G part  0        509de78a-f5c9-48ed-b887-d32c51818795
mmcblk0                  7.4G disk  0
└─mmcblk0p1  /           7.3G part  0        1e83c9ce-2656-44f4-880c-b36e49cdde63
mmcblk1                  7.3G disk  0
├─mmcblk1p1               40M part  0 boot   2979-8F05
└─mmcblk1p2              7.2G part  0 rootfs ff313567-e9f1-5a5d-9895-3ba130b4a864
mmcblk1boot0               4M disk  1
mmcblk1boot1               4M disk  1
zram0        /var/log     50M disk  0
zram1        [SWAP]     61.7M disk  0
zram2        [SWAP]     61.7M disk  0
zram3        [SWAP]     61.7M disk  0
zram4        [SWAP]     61.7M disk  0
 

Is it normal that rootfs is now on the emmc storage (I suppose) ?

I am sure that I am choosing the option "boot from SD, system on SATA / USB" when running the nand-sata-install script using armbian-config.

I also checked /etc/fstab. Here is its content :

UUID=1e83c9ce-2656-44f4-880c-b36e49cdde63 / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults,nosuid 0 0
 

Thanks in advance for the help guys.

Link to comment
Share on other sites

1 hour ago, Antony Abi Rached said:

mmcblk1                  7.3G disk  0
├─mmcblk1p1               40M part  0 boot   2979-8F05
└─mmcblk1p2              7.2G part  0 rootfs ff313567-e9f1-5a5d-9895-3ba130b4a864

Why your eMMC is having 2 partitions which first one seems to be a FAT one ?

Armbian doesn't create such partitioning ...

1 hour ago, Antony Abi Rached said:

I also checked /etc/fstab.

BTW, don't check the "fstab" of SDCard, since your rootfs is supposed to be the eMMC, you should check the "fstab" copied into the eMMC.

 

Link to comment
Share on other sites

Thanks for your reply.

In fact after checking : mmcblk1 is the SD card and not the EMMC. 

After running the script nand-sata-install, I dont know where the SSD disk is mounted as you can see from the output of the command "lsblk".

I tried to check the output of this command while the script was copying files from Sd card to SSD. I found that the mounting point is /mnt/nand-sata-install/rootfs. But when the execution of the script is finished, the mounting point is empty when I check the output of lsblk. 

In addition to that, I tried to access /mnt/nand-sata-install/ and I found there routfs and bootfs but they are empty.

If I try to reboot after the end of the script, I cannot access anymore the nanopi.

I even tried to mount the SSD disk partition on /mnt/nand-sata-install/rootfs using fstab. But also I cannot access anymore the nanopi after rebooting.

What do you thing I am doing wrong?

 

Regards,

Antony

Link to comment
Share on other sites

31 minutes ago, Antony Abi Rached said:

Just to be clear, I dont want to use the EMMC for the moment

Sorry, I've confused between eMMC and SSD ...

Did you mount /dev/sda1 into /mnt and then check the actual UUID in /mnt/etc/fstab ?

Is the rest of ROOTFS in this SSD looks right ?

Link to comment
Share on other sites

I retried the test with a new image.

This time when the execution of the script is ended, I tried to mount manually the SSD on /mnt/nand-sata-install.eGPTd1. (This is the name of the mounting point that I got this time).

When I did this, I found all the directories that I have in the mounting point / of the SD card.

You can find below the /mnt/nand-sata-install.eGPTd1/etc/fstab file :

# <file system>                                 <mount point>   <type>  <options>                                                       <dump>  <pass>
tmpfs                                           /tmp            tmpfs   defaults,nosuid                                                 0       0
UUID=1e83c9ce-2656-44f4-880c-b36e49cdde63
UUID=2979-8F05  /media/mmcboot  ext4    defaults,noatime,nodiratime,commit=600,errors=remount-ro,x-gvfs-hide    0       1
/media/mmcboot/boot                             /boot           none    bind                                                            0       0
UUID=4c5efd27-eb4c-4bf4-b605-6bb7fa395ac9       /               ext4    defaults,noatime,nodiratime,commit=600,errors=remount-ro,x-gvfs-hide    0       1

 

 

P.S : When I mounted the SSD disk manually, I dont hava anymore rootfs in /mnt/nand-sata-install.eGPTd1. 

I have directly the directories. You can find below the output of the command "ls /mnt/nand-sata-install.eGPTd1/" :
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  selinux  srv  sys  tmp  usr  var

 

Thanks in advance.

Antony
 

Link to comment
Share on other sites

You can find also the output of "sudo lsblk -o name,mountpoint,size,type,ro,label,uuid" command :


NAME         MOUNTPOINT                     SIZE TYPE RO LABEL  UUID
sda                                        55.9G disk  0
└─sda1       /mnt/nand-sata-install.eGPTd1 55.9G part  0        4c5efd27-eb4c-4bf4-b605-6bb7fa395ac9
mmcblk0                                     7.4G disk  0
└─mmcblk0p1  /                              7.3G part  0        1e83c9ce-2656-44f4-880c-b36e49cdde63
mmcblk1                                     7.3G disk  0
├─mmcblk1p1                                  40M part  0 boot   2979-8F05
└─mmcblk1p2                                 7.2G part  0 rootfs ff313567-e9f1-5a5d-9895-3ba130b4a864
mmcblk1boot0                                  4M disk  1
mmcblk1boot1                                  4M disk  1
zram0        /var/log                        50M disk  0
zram1        [SWAP]                        61.7M disk  0
zram2        [SWAP]                        61.7M disk  0
zram3        [SWAP]                        61.7M disk  0
zram4        [SWAP]                        61.7M disk  0

 

Regards,

Antony

Link to comment
Share on other sites

11 minutes ago, Antony Abi Rached said:

You can find below the /mnt/nand-sata-install.eGPTd1/etc/fstab file :

So, this seems Ok !

(BTW, since you don't wish to use eMMC, you should remove their entries in this "fstab", it can only confuse you)

Is the SDCard /boot/armbianEnv.txt is also pointing to 4c5efd27-eb4c-4bf4-b605-6bb7fa395ac9 ?

Link to comment
Share on other sites

Content of /boot/armbianEnv.txt :

 

verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=usbhost1 usbhost2
rootdev=UUID=4c5efd27-eb4c-4bf4-b605-6bb7fa395ac9
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
rootfstype=ext4
 

So normally rootdev points to the SSD disk. The format rootdev=UUID=... is correct?

 

Regards,

Antony

Link to comment
Share on other sites

@martinayotte I made sure that my serial connection is done correctly with the nanopi and redo the reboot.

I got this :

 

 

U-Boot 2018.05-armbian (Sep 12 2018 - 10:40:28 +0200) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: FriendlyARM NanoPi NEO
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0, SUNXI SD/MMC: 1
Loading Environment from EXT4... ** File not found /boot/boot.env **

** Unable to read "/boot/boot.env" from mmc0:1 **
Failed (-5)
In:    serial
Out:   serial
Err:   serial
Net:   phy interface0
eth0: ethernet@1c30000
230454 bytes read in 34 ms (6.5 MiB/s)
Unknown command 'bmp' - try 'help'
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
scanning bus 0 for devices... EHCI timed out on TD - token=0xd8d80

 

Regards,

Antony

Link to comment
Share on other sites

@martinayotte I tried to use an old image of nanopi neo core. I downloaded it around 5 months ago and the name of the image is Armbian_5.38_Nanopineo_Debian_stretch_next_4.14.14.img.

 

When I try to use the nand-sata-install script with this machine, it works normally. I boot from SD card and my file system is on the SSD disk.

 

Regards,

Antony

Link to comment
Share on other sites

4 hours ago, Antony Abi Rached said:

attached the serial debug when rebooting

According to this log, it started booting properly the /dev/sda1, but the end of log seems that it stuck on some services, unless you didn't provided full log up to "login".

1 hour ago, Antony Abi Rached said:

nand-sata-install script with this machine, it works normally.

That is strange ... But at least you have something working ...

Link to comment
Share on other sites

@martinayotte I retried the test with the most recent image of nanopi neo core. Here is the full serial debug logs.

Like you said, I guess that I didn't send the full logs previously.

As you see from the logs, there is emergency mode.

I tried to press Ctrl D like they said but it didnt worked.

What do think about that?

 

Regards,

Antony

SerialDebug.txt

Link to comment
Share on other sites

6 hours ago, Antony Abi Rached said:

As you see from the logs, there is emergency mode.

Seems to be complex issue ...

We still be that it tries to mount eMMC stuff, as I said earlier, remove then from fstab since you don't want them. Issue is probably related to that ...

Link to comment
Share on other sites

Hello again,

 

I did the test again.

I executed nand-sata-install script using armian-config.

At the end, I didn't rebbot.

I mounted the SSD disk manually.

I modified /mnt/nand-sata-install.g3nZk2/etc/fstab and removed the line corresponding to the EMMC storage.

I checked that /boot/armbianEnv.txt is pointing to the SSD disk.

I rebooted and got the following serial debug logs.

 

I got the same problem. 

P.S: I checked /etc/fstab before rebooting. I figured out that the EMMC storage is only mounted in /etc/fstab. 

I am really out of ideas regarding this problem. Hope what I explained and the logs help you figure out the problem. 

 

Regards,

Antony

SerialDebug.txt

Link to comment
Share on other sites

You still have some eMMC mounting :

Quote

[?[0;32m  OK  ?[0m] Found device /dev/disk/by-uuid/2979-8F05.
         Starting File System Check on /dev/disk/by-uuid/2979-8F05...
[?[0;32m  OK  ?[0m] Started File System Check Daemon to report status.
[?[0;32m  OK  ?[0m] Started File System Check on /dev/disk/by-uuid/2979-8F05.
         Mounting /media/mmcboot...
[?[0;1;31mFAILED?[0m] Failed to mount /media/mmcboot.
See 'systemctl status media-mmcboot.mount' for details.
[?[0;1;33mDEPEND?[0m] Dependency failed for Local File Systems.
[?[0;1;33mDEPEND?[0m] Dependency failed for /boot.

 

4 hours ago, Antony Abi Rached said:

I am really out of ideas regarding this problem.

Me too ...

Link to comment
Share on other sites

Hello there,

 

is there any "secret" how to make nand-sata-install work with a Odroid N2? I wanted to move the system to a proper SSD (USB) instead of killing the SD card with wear in the long run. There is actually a tool to accomplish this task easily: https://docs.armbian.com/User-Guide_Getting-Started/#how-to-install-to-emmc-nand-sata-usb However after power cycling the N2, it didn't boot anymore.

 

The boot.ini has been changed in fact to the UUID of my SSD:

 

setenv rootdev "UUID=5d0f77d8-xxx-xxx"
setenv rootfstype "ext4"

 

It does match:

 

root@odroidn2:/home/n2# blkid
/dev/mmcblk1p1: UUID="2b2fb355-yyy-yyy" TYPE="ext4" PARTUUID="70bd7af3-01"
/dev/sda1: UUID="5d0f77d8-xxx-xxx" TYPE="ext4" PARTUUID="70bd7af3-01"

 

At Reddit ( https://www.reddit.com/r/ODroid/comments/fp2f0k/armbian_bionic_54_tried_to_move_to_usb_ssd_doesnt/ ) I've been told to change the PARTUUID, I did so and changed the PARTUUID of the SSD - still doesn't boot, or honestly I don't know what is happening, because all I see is a black screen over HDMI.

 

I decided to roll back the boot.ini and armbian.env files to the UUID of the SD -> then it ended up in an "emergency mode".

 

Wish I had a serial cable to check the debug output, but I don't have any and shipping dates (maybe due to Covid?) are due to 3-4 weeks.

 

Do you have any suggestion how to proceed from here?

 

Link to comment
Share on other sites

3 hours ago, martinayotte said:

There is not other solution to wait receiving this serial dongle.

 

I understand that without the serial connection we won't know what is happening on my very box.

 

Maybe I should ask different questions in regards to how this move from SD to USB (SATA) works.

 

1. Is there any further actions needed after the nand-sata-install script completes? Is that working "out-of-the-box" for others?

2. Is that right that the PARTUUID shall be changed after the SD is replicated to the external drive?

3. Is there any experience with moving SD to an external SATA SSD in a USB enclosure?

4. What is usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u,0x0bc2:0x2322:u,0x1058:0x25ee:u in armbianEnv.txt?

 

BTW, this is my USB SATA being recognized, if you guys see anything relevant here... Seems like that 0x0bc2:0x2322 is related (Vendor and Product IDs), but what about the other values?

 

[  672.200956] usb 2-1.3: new SuperSpeed Gen 1 USB device number 3 using xhci-hcd
[  672.221830] usb 2-1.3: New USB device found, idVendor=0bc2, idProduct=2322, bcdDevice= 0.00
[  672.221842] usb 2-1.3: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[  672.221851] usb 2-1.3: Product: Expansion
[  672.221860] usb 2-1.3: Manufacturer: Seagate
[  672.221869] usb 2-1.3: SerialNumber: NZ0...
[  672.251170] scsi host0: uas
[  672.254784] scsi 0:0:0:0: Direct-Access     Seagate  Expansion        9300 PQ: 0 ANSI: 6
[  672.254849] usbcore: registered new interface driver uas

[  703.435448] sd 0:0:0:0: tag#21 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN
[  703.435454] sd 0:0:0:0: tag#21 CDB: opcode=0x9e, sa=0x10 9e 10 00 00 00 00 00 00 00 00 00 00 00 20 00 00
[  703.455446] scsi host0: uas_eh_device_reset_handler start
[  703.535597] usb 2-1.3: reset SuperSpeed Gen 1 USB device number 3 using xhci-hcd
[  703.556830] scsi host0: uas_eh_device_reset_handler success
[  703.567820] sd 0:0:0:0: [sda] 488397167 512-byte logical blocks: (250 GB/233 GiB)
[  703.569088] sd 0:0:0:0: [sda] Write Protect is off
[  703.569091] sd 0:0:0:0: [sda] Mode Sense: 4f 00 00 00
[  703.569289] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  703.569511] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes
[  703.593112]  sda: sda1
[  703.594248] sd 0:0:0:0: [sda] Attached SCSI disk

 

 

Link to comment
Share on other sites

On 4/13/2020 at 10:08 AM, Werner said:

Try to use usbstorage instead of uas.

 

Add the idVendor and idProdukt to the usbstoragequirks at /boot/armbianEnv.txt

 

But those are already there: ,0x0bc2:0x2322:u,

 

u = IGNORE_UAS (don't bind to the uas driver);

Link to comment
Share on other sites

Three updates here till I'm waiting for that UART cable to be delivered...

 

1. Tried with another SATA-USB enclosure, and I see a similar pattern here, check the timestamps:

 

[  375.366411] usb 2-1.1: new SuperSpeed Gen 1 USB device number 4 using xhci-hcd
[  375.387499] usb 2-1.1: New USB device found, idVendor=152d, idProduct=0578, bcdDevice= 2.03
[  375.387511] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  375.387520] usb 2-1.1: Product: External Disk 3.0
[  375.387529] usb 2-1.1: Manufacturer: JMicron
[  375.387538] usb 2-1.1: SerialNumber: DB12345681BC
[  375.391386] scsi host0: uas
[  375.392410] scsi 0:0:0:0: Direct-Access     JMicron  Tech             0203 PQ: 0 ANSI: 6
[  406.488988] sd 0:0:0:0: tag#5 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN
[  406.488998] sd 0:0:0:0: tag#5 CDB: opcode=0x12 12 01 00 00 40 00
[  406.509006] scsi host0: uas_eh_device_reset_handler start
[  406.589332] usb 2-1.1: reset SuperSpeed Gen 1 USB device number 4 using xhci-hcd
[  406.611661] scsi host0: uas_eh_device_reset_handler success
[  406.617474] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks: (250 GB/233 GiB)
[  406.617481] sd 0:0:0:0: [sda] 4096-byte physical blocks
[  406.617655] sd 0:0:0:0: [sda] Write Protect is off
[  406.617665] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[  406.617959] sd 0:0:0:0: [sda] Disabling FUA
[  406.617966] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  406.618258] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
[  406.644251]  sda: sda1
[  406.645838] sd 0:0:0:0: [sda] Attached SCSI disk

It takes ~30 seconds to get the drive as SDA1 recognized! The same happened with that Seagate enclosure...

 

I suppose that's a no-GO during boot time. Is there any way to add a delay to the boot process, let's give the N2 some time to recognize the USB drive?

 

2. Tried the SD to USB move with a plain simple USB flash drive. Works without a glitch, but at the same time, the UFD is recognized as a USB storage device like in no time compared to the above examples.

 

3. The most disappointing thing was that the enclosure was totally not recognized after a reboot, only after I disconnected and reconnected to the USB port. That excludes then any remote or unattended functionality, a total deal breaker, but I suppose this is Odroid's fault, and not something Armbian could do anything...

Link to comment
Share on other sites

On 4/12/2020 at 2:31 PM, martinayotte said:

There is not other solution to wait receiving this serial dongle.

 

Alright, I received the serial cable, but I'm not wiser at all.

 

- odroid N2 flashed and boots from SD:

 

root@odroidn2:/boot# uname -a
Linux odroidn2 5.4.21-meson64 #20.02.3 SMP PREEMPT Fri Feb 21 17:46:54 CET 2020 aarch64 aarch64 aarch64 GNU/Linux

- nand-sata-install script executed, SD to USB (Ext4) successful

- boot.ini is changed in fact to the USB enclosure's GUID

- after reboot, NOTHING, just the black screen.

 

Honestly I don't know what should I look for in the serial log. It is also stuck there:

 


bestmode is custombuilt, IEEEOUI 0x000c03
HDMI Mode
21543488 bytes read in 1206 ms (17 MiB/s)
69790 bytes read in 33 ms (2 MiB/s)
9586682 bytes read in 554 ms (16.5 MiB/s)
ee_gate_off ...
## Booting kernel from Legacy Image at 01080000 ...
   Image Name:   Linux
   Image Type:   AArch64 Linux Kernel Image (uncompressed)
   Data Size:    21543424 Bytes = 20.5 MiB
   Load Address: 01080000
   Entry Point:  01080000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 03700000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    9586618 Bytes = 9.1 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
load dtb from 0x1000000 ......
## Flattened Device Tree blob at 01000000
   Booting using the fdt blob at 0x1000000
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
   Loading Kernel Image(COMP_NONE) ... OK
   kernel loaded at 0x01080000, end = 0x0250ba00
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
[rsvmem] fdt get prop fail.
   Loading Ramdisk to 3cedb000, end 3d7ff7ba ... OK
   Loading Device Tree to 000000001ffeb000, end 000000001ffff09d ... OK

Starting kernel ...

uboot time: 11402365 us

Compared to the working scenario (only from SD, before the move to USB-SSD):

 


Starting kernel ...

uboot time: 10797279 us
[    4.742576] debugfs: Directory 'ff800280.cec' with parent 'regmap' already present!
[    4.746987] pwm-regulator regulator-vddcpu-a: Failed to get PWM: -517
[    4.753785] cpu cpu2: Failed to set regulator for cpu2: -517
[    4.759331] cpu cpu3: Failed to set regulator for cpu3: -517
[    4.762478] cpu cpu4: Failed to set regulator for cpu4: -517
[    4.767950] cpu cpu5: Failed to set regulator for cpu5: -517


Armbian 20.02.3 Bionic ttyAML0 

odroidn2 login:

How to continue from here...?

Link to comment
Share on other sites

Not sure if we have a problem with nand-sata-installer here ... more with a USB subsystem on N2 which is known for troubles. I plan to add nand-sata-install procedure to auto tests facility once. In such case we would know at once if the problem is present generally, just on N2 or you made something wrong.

@vzoltan This is needed to solve problems quicker and smarter:

 

- writing a test case

- contributing a stash of USB3 keys for:

 

Since we don't have autotest support ATM, we need to see logs. Or spent some precious time - I have no idea where to pull it from - to recreate this and try to fix.

 

7 hours ago, vzoltan said:

Honestly I don't know what should I look for in the serial log. It is also stuck there:


Do you have the same log from a working variant?

Link to comment
Share on other sites

6 hours ago, Igor said:

Not sure if we have a problem with nand-sata-installer here ... more with a USB subsystem on N2 which is known for troubles. I plan to add nand-sata-install procedure to auto tests facility once. In such case we would know at once if the problem is present generally, just on N2 or you made something wrong

 

Update here, as I don't want you guys overthink this issue.

 

Later this morning I totally gave up on the latest 5.4 kernel images, and tried with a 4.9.x as in other forums I've been told.

 

That works PERFECTLY.

 

Therefore I tend to say this is a Linux kernel issue, and there shall be some kind of regressions regarding USB handling in the 5.x branch.

 

Quote

Do you have the same log from a working variant?

 

I do, but as stated above, it might not be that relevant anymore, we are looking for a Linux issue here.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines