rootfs on SATA disk

1,978 views
Skip to first unread message

maruprez

unread,
Feb 22, 2013, 12:04:29 PM2/22/13
to cubie...@googlegroups.com
Hi,
My SATA disk is working !!

Now I would like to use SATA disk to host rootfs.

  • I've copied with gparted /dev/mmcblk0p2 to /dev/sda1.
  • On boot.cmd changed root=/dev/mmcblk0p2 to root=/dev/sda1
  • then mkimage -C none -A arm -T script -d boot.cmd boot.scr
  • and finally reboot.

Sadly it didn't boot.. Any sugestion?

Thanks



Floris Bos

unread,
Feb 22, 2013, 12:07:15 PM2/22/13
to cubie...@googlegroups.com
Make sure the kernel you are using has SATA support built-in, instead of as a module.


Yours sincerely,

Floris Bos

maruprez

unread,
Feb 22, 2013, 1:43:48 PM2/22/13
to cubie...@googlegroups.com
Floris,

You're rigth !. Now I'm working from SATA.

Thanks so much!

Maruprez

Martin Wild

unread,
Feb 22, 2013, 2:19:03 PM2/22/13
to cubie...@googlegroups.com
Is this all you did ?

This sounded way more complicated  last time !
Which kernel are you using right now?

Regards, Martin

maruprez

unread,
Feb 22, 2013, 3:36:42 PM2/22/13
to cubie...@googlegroups.com
Hi Martin,

Yes, this is all I did.

I am using a kernel 3.0.57 compiled by myself

Maruprez

Mirek H.

unread,
Feb 23, 2013, 10:21:21 AM2/23/13
to cubie...@googlegroups.com
I've seen big thread about difficulties to get SATA disk working.

Is your disk powered via cubieboard? And is this SSD or "regular" HDD?
In case you are successfully running 2.5" HDD (not SSD) powered via cubieboard, please can you share info about what HDD and power supply do you use?

Thanks
Mirek

Dne pátek, 22. února 2013 18:04:29 UTC+1 maruprez napsal(a):

maruprez

unread,
Feb 23, 2013, 12:06:22 PM2/23/13
to cubie...@googlegroups.com
Hi Marek,

I'm using an old 2,5" Hitachi 80 GB disk .

Now I'm  using a 1,5 A psu with the barrel plug, plus another one to the OTG. This one is a USB A to mini USB B cable like this one : http://www.amazon.com/AmazonBasics-A-Male-Mini-B-Cable-Meters/dp/B001TH7GUK/ref=sr_1_1?ie=UTF8&qid=1361638458&sr=8-1&keywords=usb+to+mini+usb+cable

Next week I will receive a new 5V 3A psu to feed the whole set (barrel plug)

Hope this helps

Maruprez

Alexandr Shutko

unread,
Feb 24, 2013, 2:57:39 AM2/24/13
to cubie...@googlegroups.com
I have cubie running linaro with rootfs on 64Gb kingmax smp35 SSD sata disk. 
Graphics/mali disabled. Ethernet connected. No usb devices. 

This configuration boots in 10 seconds (from power-on to console).
Average power consumption is 200ma at performance cpu mode and 160ma with ondemand.
Max 390ma running dd if=/dev/zero of=/file bs=1M + scp copy of 400Mb file.

System is much faster than runnning from sd card.

Alexandr Shutko

unread,
Feb 24, 2013, 5:48:08 AM2/24/13
to cubie...@googlegroups.com
Sorry, I noticed that all current measurements was made before 12V-5V DCDC converted, so all current values should be multiplied by 2.2

воскресенье, 24 февраля 2013 г., 18:57:39 UTC+11 пользователь Alexandr Shutko написал:

Mirek H.

unread,
Feb 24, 2013, 7:06:13 AM2/24/13
to cubie...@googlegroups.com
Thank you, it helped!
Just as this is OT for your initial question I started new topic https://groups.google.com/d/topic/cubieboard/6BhBQZt_yfs/discussion

Mirek

Dne pátek, 22. února 2013 18:04:29 UTC+1 maruprez napsal(a):
Hi,

maruprez

unread,
Feb 25, 2013, 10:17:39 AM2/25/13
to cubie...@googlegroups.com
Hi everybody,

Just to inform. I've tried a new 5V 3A PSU  feeding Cubieboard only by the barrel plug and it works.

Maruprez

Stas Xymox

unread,
Feb 28, 2013, 1:27:57 PM2/28/13
to cubie...@googlegroups.com
Hi, could you, please, post step by step explanation how to move rootfs from sdcard to hdd? 
And if its posible whithout gui (im not using gui on my cubieboard).

пятница, 22 февраля 2013 г., 20:04:29 UTC+3 пользователь maruprez написал:

maruprez

unread,
Feb 28, 2013, 3:39:29 PM2/28/13
to cubie...@googlegroups.com
Hi Stas,

Basically it's explained on the first post of this thread.

  1. Prepare your disk partition with parted or similar tool . Suppose that you use /dev/sda1
  2. I suppose you are working from SD card with your preferred distro in my example I use partition 2 = /dev/mmcblk0p2
  3. Copy rootfs partition on SD to disk using dd:  dd if=/dev/mmcblk0p2 of=/dev/sda1
  4. On the boot partition on SD update your boot.scr or uEnv.txt in my example boot.scr. Edit boot.cmd and change root parameter from /dev/mmcblk0p2 to /dev/sda1.
  5. using mkimage generate new boot.scr : mkimage -C none -A arm -T script -d boot.cmd boot.scr
  6. copy new boot.scr to your SD boot partition
  7. Reboot

That's all

Hope this helps

Maruprez

barbi...@gmail.com

unread,
Mar 1, 2013, 10:14:51 PM3/1/13
to cubie...@googlegroups.com
In my SD boot partition I only have script.bin and uImage file.

How do I edit these files to boot from sata ??

Patrick Wood

unread,
Mar 1, 2013, 10:59:29 PM3/1/13
to cubie...@googlegroups.com
You'll need to create *either* uenv.txt *or* boot.scr; you don't need both, and in fact, only one is loaded (can't remember the order that they're checked, but I only use uEnv.txt as I can make it with a text editor and don't need to "compile" it to make changes).  Without either file, the system boots using default settings from uboot.  That's what you're getting.  So you need to make a file that overrides these defaults, e.g., put this line in uEnv.txt:

root=/dev/sda1

barbi...@gmail.com

unread,
Mar 2, 2013, 7:05:42 AM3/2/13
to cubie...@googlegroups.com
Thanks Patrick,

I created the uEnv and it seems that the board really tries to boot from the sata, but after a few seconds it restarts.
When I remove the uEnv file the board starts from SD.

When the board starts the system by SDcard the sata driver is automatically recognized. lsmod shows sw_ahci_platform.

This means that my kernel not have built-in support for SATA??

maruprez

unread,
Mar 2, 2013, 12:00:23 PM3/2/13
to cubie...@googlegroups.com
Hi,

Look at the second post of the thread.  SATA must be built-in the kernel not as a module.

Maruprez

Patrick Wood

unread,
Mar 2, 2013, 1:37:09 PM3/2/13
to cubie...@googlegroups.com
Any module reported by lsmod is not built in.

barbi...@gmail.com

unread,
Mar 3, 2013, 12:52:21 AM3/3/13
to cubie...@googlegroups.com
Could you post a step by step or a link to a "howto" on how to compile the kernel with built-in support for sata ?

Thanks

Patrick Wood

unread,
Mar 3, 2013, 1:40:24 PM3/3/13
to cubie...@googlegroups.com
Set CONFIG_SW_SATA_AHCI_PLATFORM and CONFIG_SATA_AHCI_PLATFORM to y in sun4i_defconfig and follow the normal build instructions for the kernel.

barbi...@gmail.com

unread,
Mar 5, 2013, 7:20:17 AM3/5/13
to cubie...@googlegroups.com
Thanks a lot !

This worked
.

Jiri Kastner

unread,
Mar 8, 2013, 7:58:13 AM3/8/13
to cubie...@googlegroups.com
not true,
generate ramdisk using dracut and append rd.driver.pre=sw_ahci_platform to boot args in boot.cmd

Jérémie Astori

unread,
Mar 13, 2013, 6:59:49 PM3/13/13
to cubie...@googlegroups.com
Hi,

I created the uEnv and it seems that the board really tries to boot from the satabut after a few seconds it restarts.
I would like to know where about you have put the uEnv.txt file.
At this point, I created a uEnv.txt file (filled only with: "root=/dev/sda1") in /boot on the SD card, but it seems to completely ignore it.

Thanks a lot,

Jérémie Astori


--
You received this message because you are subscribed to the Google Groups "Cubieboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cubieboard+...@googlegroups.com.
Visit this group at http://groups.google.com/group/cubieboard?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alexandr Shutko

unread,
Mar 13, 2013, 7:04:36 PM3/13/13
to cubie...@googlegroups.com
mkdir 1
mount /dev/mmcblk0p1 1
echo "root=/dev/sda1" > 1/uEnv.txt
umount 1
Message has been deleted
Message has been deleted

Jérémie Astori

unread,
Mar 14, 2013, 4:04:59 PM3/14/13
to patric...@gmail.com, cubieboard
Hi Patrick,

Is it the only line you have in your uEnv.txt file?
I tried what you recommended but the system ignores my uEnv.txt file.

Thanks,

Jérémie Astori


2013/3/2 Patrick Wood <patric...@gmail.com>

Roman Mamedov

unread,
Mar 14, 2013, 4:14:25 PM3/14/13
to cubie...@googlegroups.com, jer...@astori.fr, patric...@gmail.com
On Thu, 14 Mar 2013 21:04:59 +0100
Jérémie Astori <jer...@astori.fr> wrote:

> Hi Patrick,
>
> Is it the only line you have in your uEnv.txt file?
> I tried what you recommended but the system ignores my uEnv.txt file.

Try upgrading your u-boot to the latest available in a hwpack for your board
See http://linux-sunxi.org/Hwpack , "Updating your SD-card with u-boot from a
hwpack manually"

--
With respect,
Roman
signature.asc
Message has been deleted

Patrick Wood

unread,
Mar 14, 2013, 5:01:22 PM3/14/13
to cubie...@googlegroups.com, jer...@astori.fr, patric...@gmail.com
And make sure you remove your boot.scr file (because it's loaded *after* uEnv.txt so it could overwrite the root variable), and make sure your uEnv.txt file is in a place that u-boot checks:  the top directory of /dev/mmcblk0p1, the top directory of  /dev/mmcblk0p2 or /boot of  /dev/mmcblk0p2, but *only if this is an ext2 file system!*  The u-boot command that loads uEnv.txt looks like this:

fatload mmc 0 $scriptaddr ${bootenv} || ext2load mmc 0 $scriptaddr ${bootenv} || ext2load mmc 0 $scriptaddr boot/${bootenv}

and it does not attempt to load uEnv.txt from an ext4 file system (bootenv is set to uEnv.txt).  Perhaps we should ask the maintainers of u-boot for sunxi to change this from ext2 to ext4 (I've done that in my own version, and it works great; it also allows me to get rid of the vfat partition on the mmc and load uEnv.txt and uImage directly from /boot in the root file system).

Pat

Jérémie Astori

unread,
Mar 14, 2013, 5:11:34 PM3/14/13
to Patrick Wood, cubieboard
Patrick,

I have no boot.scr in my /boot (which is in fact /dev/mmcblk0p1), only: Roman's *-3.0.57-r2-rm1, the *.bin files, uEnv.txt and uImage.
Also, when I cfdisk on mmcblk0, I see that mmcblk0p1 is in vfat and mmcblk0p2 is in ext4.

Am I doing something wrong according to you?

It is starting to making me nuts.

Thanks anyway!!

Jérémie Astori


2013/3/14 Patrick Wood <patric...@gmail.com>

Patrick Wood

unread,
Mar 14, 2013, 5:37:53 PM3/14/13
to cubie...@googlegroups.com, Patrick Wood
The only thing I can think of is putting something in uEnv.txt that will allow you to see if its contents are really being passed to the kernel, e.g.,

  extraargs=mac_addr=3a:f3:cf:c5:d8:ca

and then looking at the contents of /proc/cmdline after booting for mac_addr=3a:f3:cf:c5:d8:ca.  Another possibility is to capture the u-boot messages on the serial port before the kernel is started.

Pat
Message has been deleted

barbi...@gmail.com

unread,
Mar 14, 2013, 6:22:57 PM3/14/13
to cubie...@googlegroups.com, Patrick Wood
I recommend you try to build everything from scratch. That's what worked for me.
(
Do not forget to compile the kernel with (Set CONFIG_SW_SATA_AHCI_PLATFORM and CONFIG_SATA_AHCI_PLATFORM to y in sun4i_defconfig)

Look in  http://linux-sunxi.org/Main_Page

See the 'How Tos'
:

Debian/Debian From Debian



Em quinta-feira, 14 de março de 2013 19h00min33s UTC-3, Jérémie Astori escreveu:
I added your line after:
root=dev/sda1 rootwait

and after booting...

~# cat /proc/cmdline
console=ttyS0,115200 root=/dev/mmcblk0p2 init=/init loglevel=8 rootfstype=ext4 rootwait

It's completely ignoring my uEnv.txt... :-(





2013/3/14 Patrick Wood <patric...@gmail.com>

Jérémie Astori

unread,
Mar 14, 2013, 6:43:52 PM3/14/13
to cubieboard, Patrick Wood
@Patrick: as I don't really have another choice, I should try to capture the u-boot messages on the serial port.
I am quite new to all of that. I have the USB/serial cable, what should I do to get those messages?

@barbieri00: I might do that eventually, but I am not very familiar with everything for now, so I might end up nowhere actually. Plus I don't know why Roman's kernel/image could prevent me to achieve what I am trying to do...

Jérémie Astori

2013/3/14 <barbi...@gmail.com>

Jérémie Astori

unread,
Mar 15, 2013, 7:08:10 AM3/15/13
to Pat, cubieboard
At some point, I should see "*Reading uEnv.txt*" or something similar, right?
I don't see anything like that...
I didn't manage to use picocom but I use screen (as the doc says). Problem is, screen does not allow me to scroll so I might miss something. Is there a way to outpout it in a file? Using "> file.txt" does not work.

Anyway, I am still stuck... :-(

Thanks for all the help!

Jérémie Astori


2013/3/14 Pat <patric...@gmail.com>
You'll need a terminal emulator, something like putty for windows or picocom for linux.  When you connect the USB->serial dongle to your linux system, it shows up as /dev/ttyUSB0 if it's the only serial dongle, or /dev/ttyUSB<n> if you have several.  I use picocom to connect to the board:

picocom -b 115200 /dev/ttyUSB0

I cut and paste the serial console log as needed.  Exit picocom with CTRL-a CTRL-x (or unplug the USB cable).

Pat

Marcos Martinez

unread,
Mar 15, 2013, 7:31:58 AM3/15/13
to cubie...@googlegroups.com
For some commands like screen the usual output redirection commands don't work. Take a look to the tee command man page, it should allow you to capture  the full serial boot log.

Enviado desde mi iPhone

Jérémie Astori

unread,
Mar 15, 2013, 10:35:28 AM3/15/13
to Pat, cubieboard
For those who might help me, I'll post on a separate thread only from now on: 

Jérémie Astori


2013/3/15 Jérémie Astori <jer...@astori.fr>

boogieman

unread,
Aug 28, 2013, 11:09:15 AM8/28/13
to cubie...@googlegroups.com, Pat


salut, j'essaie de rassembler des francophones pour un forum cubieboard,  trop facile point net.
si ça t'interesse...
Reply all
Reply to author
Forward
0 new messages