SATA problem - not booting from harddisk

Discussion in 'Troubleshooting' started by Steve1965, Jan 27, 2014.

  1. Steve1965

    Steve1965 New Member

    Joined:
    Jan 24, 2014
    Messages:
    11
    Likes Received:
    0
    Hi guys,

    I'm facing a strange problem concerning the boot behaviour with my UDOO quad. I installed Linaro Ubuntu 12.04 on a 2.5 inch harddisk by using dd and I set the root to sda1 in U-Boot as you can see below. Nevertheless UDOO still keeps booting from the SD card. Did I miss something??? The harddisk is working properly - i can mount sda1 without any problems after that I've booted from the SD card ...

    Any ideas ?

    Greetinx, Steve

    U-Boot 2013.10-rc3-svn109 (Nov 27 2013 - 17:36:22)

    CPU: Freescale i.MX6Q rev1.2 at 792 MHz
    Reset cause: WDOG
    Board: UDOO
    DRAM: 1 GiB
    MMC: FSL_SDHC: 0
    No panel detected: default to LDB-WVGA
    Display: LDB-WVGA (800x480)
    In: serial
    Out: serial
    Err: serial
    Net: using phy at 6
    FEC [PRIME]
    Hit any key to stop autoboot: 0
    UDOO board => printenv
    baudrate=115200
    boot_fdt=try
    bootcmd=mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loaduimage; then run mmcboot; else run netboot; fi; fi; else run netb
    oot; fi
    bootdelay=5
    bootscript=echo Running bootscript from mmc ...; source
    console=ttymxc1
    ethact=FEC
    ethaddr=00:c0:08:88:21:9e
    ethprime=FEC
    fdt_addr=0x11000000
    fdt_file=imx6q-udoo.dtb
    fdt_high=0xffffffff
    initrd_high=0xffffffff
    ip_dyn=yes
    loadaddr=0x12000000
    loadbootscript=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
    loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
    loaduimage=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}
    mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} ${hdmi_patch} fbmem=24M video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32
    mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootm ${loadaddr} - ${fdt_addr}; else if test
    ${boot_fdt} = try; then bootm; else echo WARN: Cannot load the DT; fi; fi; else bootm; fi;
    mmcdev=0
    mmcpart=1
    mmcroot=/dev/mmcblk0p1 rootwait rw
    netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ${hdmi_patch} ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
    netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${uimage}; if test ${boot_fdt} =
    yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootm ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootm; else echo WARN
    : Cannot load the DT; fi; fi; else bootm; fi;
    root=root=/dev/sda1
    script=boot.scr
    splashpos=m,m
    uimage=/boot/uImage
    update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmware_filename};
    then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi
    update_sd_firmware_filename=u-boot.imx

    Environment size: 2097/8188 bytes

    UDOO board => boot
    mmc0 is current device
    ** File not found boot.scr **
    4221412 bytes read in 284 ms (14.2 MiB/s)
    Booting from mmc ...
    ** File not found imx6q-udoo.dtb **
    ## Booting kernel from Legacy Image at 12000000 ...
    Image Name: Linux-3.0.35
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 4221348 Bytes = 4 MiB
    Load Address: 10008000
    Entry Point: 10008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK

    Starting kernel ...
     
  2. Steve1965

    Steve1965 New Member

    Joined:
    Jan 24, 2014
    Messages:
    11
    Likes Received:
    0
    [solved] Re: SATA problem - not booting from harddisk

    Hi everybody,

    I found the solution to my problem by playing around with the environment variables in UBOOT.
    So if you got the same problem as I did you might want to try the following:

    Don't mess around with

    setenv root root=/dev/sda1 (or whatever your harddisk device might be)

    instead try seting

    setenv mmcroot root=/dev/sda1 rootwait rw

    In my case that was the solution!!! Now root gets mounted from my SATA disk! :D :D

    Cheers! :D
     
  3. DangerousThing

    DangerousThing New Member

    Joined:
    Jan 23, 2014
    Messages:
    21
    Likes Received:
    0
    Steve,

    Does this boot without a micro SD card installed?

    Once I get my disk recognized, I plan on booting from it.
     
  4. Steve1965

    Steve1965 New Member

    Joined:
    Jan 24, 2014
    Messages:
    11
    Likes Received:
    0
    Hi DangerousThing,

    no, sorry I forgot to mention that ... the SD card is still needed. So you still have the kernel on the SD card but the linux root file systems on the SATA disk which should give you a better performance. I don't know why the 'official' way to enable SATA was not workinging for me. Apparently I am the only one experiencing this problem which is indeed quite curious ...
     
  5. DangerousThing

    DangerousThing New Member

    Joined:
    Jan 23, 2014
    Messages:
    21
    Likes Received:
    0
    Thanks. I have a few more questions if you don't mind:

    What do you really need on the SSD card, or did you not experiment? In other words, can I just have a /boot with the kernel on it and forget the rest?

    Currently I have a 64 GB micro SSD that will pretty much be doing nothing shortly. I guess i could go back to my 8 gig card.

    To get my drive recognized I used the ubuntu image at Udoo and the win32 imager, and then expanded the base partition and added a swap partition with gparted, but to do that I had to drag a monitor, mouse, keyboard and such to my bedroom (yes, I have my Udoo in a box on my bed at the moment). I'm planning to run headless, so I was hoping I didn't need to do anything with a windowing system. I strongly suspect that the parted that comes with Udoo's Ubuntu is extremely outdated.

    I'm hoping that swap works because I did put a 2.2 gig swap partition.

    Now all I have to do is to figure out how to get wireless networking working without the windowing system (it works fine when I dragged all that stuff back here...).

    Thanks much for the start. I about to put about 800 GiB of SSD drive on my machine.

    Have a nice day!
     
  6. Steve1965

    Steve1965 New Member

    Joined:
    Jan 24, 2014
    Messages:
    11
    Likes Received:
    0
    Hi again,

    I haven't yet tried to remove most of the files from the SDcard because I have only used a 8GB card .... so it is going to stay in UDOO anyway.
    But I think you're right - the only thing that is needed on the SDcard is the /boot containing the kernel. I think I read that somewhere either in the manual of in the forum.

    Adding a swap partition should work. I haven't tried it 'cause I'm using my UDOO as a NAS server running the OpenMediaVault distribution (with a custom kernel) and memory consumption has never been higher that 50% so there was no need to add swap space.

    I'm also running my UDOO headless which makes sense for a NAS server. In case I need to access UDOO I'm connecting via ssh or even sometimes using the USB connection and a terminal emulation, e.g. when I was playing around with the boot parameter of U-Boot13.
     
  7. DangerousThing

    DangerousThing New Member

    Joined:
    Jan 23, 2014
    Messages:
    21
    Likes Received:
    0
    I'm running from the disk now. I'd like the swap partition because I want to compile everything from scratch, including the kernel. It's how I've run every Linux system I've ever run. Since I'm using this board purely as an experimental system, I don't think it will matter much. I'm doing the main programming on the Udoo board so that I can transfer what I am doing to my Raspberry Pi later if the project will fit there. Mostly I'm using ssh to log in, but I want a windowing system available to me,

    I want to run a media panel that will tailor its media based on facial recognition and some basic like/don't like inputs from the user. That's project 1. After I get my 3d printer, I will build a few robots. I'll start with a couple of small wheeled ones, then go for a dog-sized hexapod if I can get the funds. :). Otherwise, a larger dog-sized wheeled robot that I can use as an experimental platform to see if I can build something to help my wheelchair bound wife.
     
  8. evilpengw1n

    evilpengw1n New Member

    Joined:
    Oct 21, 2013
    Messages:
    26
    Likes Received:
    0
    Did you have any other issues? This is the part I'm stuck at, but it's still not booting.
    I used the linaro 12.04 image to get u-boot 2013. flashed it to the micro, same with the sata drive. Used gparted to expand the sata drive to full, adding swap. Hooked it up to the drive. just changing root in setenv, disk showed up in fdisk but wasn't being booted from. Did your method (changing mmcroot), it just hangs at:

    Code:
    [    2.876063] Waiting for root device root=/dev/sda1...
    [    3.057066] usb 2-1.3: new high speed USB device number 4 using fsl-ehci
    

    Edit: Fixed
    You had a typo... =)

    Code:
    setenv mmcroot /dev/sda1 rootwait rw 
    Booted succesfully:
    Code:
    ubuntu@udoo:~$ df -mh
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/root       456G  2.4G  431G   1% /
    devtmpfs        438M  4.0K  438M   1% /dev
    none             88M  2.6M   86M   3% /run
    none            5.0M     0  5.0M   0% /run/lock
    none            438M   88K  438M   1% /run/shm
    
     
  9. Steve1965

    Steve1965 New Member

    Joined:
    Jan 24, 2014
    Messages:
    11
    Likes Received:
    0
    oops, sorry for the typo - thanks for putting it right!
     

Share This Page