Welcome! Log In Create A New Profile

Advanced

ext4 hard support in boot image uImage ?

Posted by Sagittarius 
ext4 hard support in boot image uImage ?
August 21, 2010 06:57PM
First of all, thank you very much for what you have done.

Second, I was wondering if it is possible to modfiy the Squeeze script and boot on a ext4 sda1 partition on a real hard drive (no USB Flash).

;-)
Re: ext4 hard support in boot image uImage ?
August 21, 2010 07:05PM
USB hard drives are fine. Ext4 should just be a matter of adjusting fstab and, possibly, the uBoot kernel parameters.

Edit: Summary of changes for anyone else working on ext4:

1) run 'fw_setenv usb_rootfstype ext4'
2) in your Debian install, edit /etc/fstab and change ext2 to ext4



Edited 1 time(s). Last edit at 08/25/2010 08:02AM by Jeff.
Re: ext4 hard support in boot image uImage ?
August 21, 2010 07:09PM
It was quick !
Thank you.
Re: ext4 hard support in boot image uImage ?
August 22, 2010 02:58AM
I've also tried to use the lenny script modified to boot on a USB Key aligned partitions:

(parted) print
Model: Kingston DT Mini 10 (scsi)
Disk /dev/sda: 7833600s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 256s 7168255s 7168000s primary ext3 boot
2 7168256s 7826383s 658128s primary linux-swap


In the script, I've changed these lines :

- $SRC/mke2fs -L Lenny -t ext3 -b 4096 -E stride=32 $ROOT_DEV
/sbin/mkswap -L Swap $SWAP_DEV
- and the fstab according to ext3 with noatime parameter

It's Ok with ext3 but for info, not for ext4

Edit: well not so good:
#dmesg|grep warning
EXT2-fs (sda1): warning: mounting ext3 filesystem as ext2



Edited 2 time(s). Last edit at 08/22/2010 05:22AM by Sagittarius.
Re: ext4 hard support in boot image uImage ?
August 22, 2010 04:22PM
No more success for xfs. It seems only ext2 is available to boot the system, am I right ?
After the boot, of course every file system is seen.

I managed to install Dolibarr ERP (with Lighttpd, PHP5, MySql) on a 2"5 HDD, and I would prefer to run it with a Journalised fs.
The workaround I found was to define a /var (ext4) partition after installation. Maybe there is something better to do, but I am afraid I am not able to build a boot image considering ext4 on that little ARM system.
Re: ext4 hard support in boot image uImage ?
August 23, 2010 09:04AM
So adjusting only the fstab seems not efficient to have a journalised file system.

So, does someone has an idea for how to adjust, as Jeff said, the uBoot kernel parameters ?



Edited 1 time(s). Last edit at 08/23/2010 09:05AM by Sagittarius.
Re: ext4 hard support in boot image uImage ?
August 23, 2010 09:21AM
I'd start with
fw_setenv usb_rootfstype ext4
fw_printenv will show you the configured boot variables.

-- Jeff



Edited 1 time(s). Last edit at 08/23/2010 09:21AM by Jeff.
Re: ext4 hard support in boot image uImage ?
August 23, 2010 09:38AM
Thank you very very much !
Re: ext4 hard support in boot image uImage ?
August 23, 2010 10:42AM
It works great ! :D

Thank you again Jeff for what you have done.

I've come also to install a little webdav server.
This little plugcomputer is very usefull.
Re: ext4 hard support in boot image uImage ?
September 22, 2010 03:54PM
Hello everybody!!!

Is there an "or" option?

For example
fw_setenv usb_rootfstype ext2 "or" ext4
Max
Re: ext4 hard support in boot image uImage ?
September 27, 2010 06:16AM
Unfortunately this doesn't seem to work for me.
I've used your dockstar.debian-squeeze.sh script to install debian on a usb hdd.
Then i've made a backup of the root of /dev/sda1 and reformatted it with mkfs.ext4. After copying the backup into the newly created ext4 and plugging it into the dockstar - the dockstar won't boot it. It only boots the original software.
And yes, i've already used fw_setenv to set the usb_rootfstype to ext4.

Is there something else i need to do?
Re: ext4 hard support in boot image uImage ?
September 27, 2010 06:28AM
ext4 is in my kernel includet !!
Max
Re: ext4 hard support in boot image uImage ?
September 27, 2010 07:18AM
@gorgone:
Well, that's not the problem. The kernel from Debian Squeeze should include ext4 as well.

To me it seems like uBoot doesn't support the ext4 fs, since it can't get the kernel from /boot.
Here's the output from the serial console:

scanning bus for devices... 3 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
** File not found /boot/uImage
** Block device usb 1 not supported
** Block device usb 2 not supported
** Block device usb 3 not supported
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
** File not found /boot/uImage
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
** File not found /boot/uInitrd
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..
ecc
Re: ext4 hard support in boot image uImage ?
September 27, 2010 07:37AM
Max Wrote:
-------------------------------------------------------
> To me it seems like uBoot doesn't support the ext4 fs, since it can't get the kernel from /boot.

That's correct; there's no ext4 support in u-boot, just ext2. (Booting from ext3 also works because it's backwards-compatible.)

So you'll need to load the kernel uImage from somewhere else: either a raw partition, or from a boot partition formatted in a way u-boot understands. Currently those are:
  • cramfs
  • ext2
  • fat
  • fdos
  • jffs2
  • reiserfs
  • ubifs
  • yaffs2
Max
Re: ext4 hard support in boot image uImage ?
September 27, 2010 12:54PM
Ah i see. Thanks a lot!
So i'll make a dedicated boot partition with the kernel and change the usb_set_bootargs parameter to use the ext4 root partition.
Re: ext4 hard support in boot image uImage ?
September 27, 2010 02:20PM
I have no dedicated partition

Under Lenny
# dmesg|grep ext
Kernel command line: console=ttyS0,115200 root=/dev/sda2 rootdelay=10 rootfstype=ext4 mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
VFS: Mounted root (ext4 filesystem) on device 8:2.
Adding 2047992k swap on /dev/sda1.  Priority:-1 extents:1 across:2047992k

ext4 is there
#cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   tmpfs
nodev   debugfs
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   rpc_pipefs
nodev   inotifyfs
nodev   devpts
        ext3
        ext2
        ext4
        cramfs
nodev   ramfs
        vfat
        msdos
nodev   nfs
nodev   nfs4
nodev   jffs2
        jfs
nodev   oprofilefs
nodev   ubifs

Here is my fstab
#cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>                       <dump>  <pass>
none            /dev/pts        devpts  defaults                        0       0
none            /dev/shm        tmpfs   nodev,nosuid                    0       0

/dev/sda1       none            swap    sw                              0       0
/dev/sda2       /               ext4    defaults,noatime                0       1
/dev/sda4       /var/www/davsBox ext4   rw,noatime                      0       0

Well, the trick is that you have to go first to ext3 on your partition because:
under Pogoplug: filesystems available
Pogoplug:~$ cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   futexfs
nodev   tmpfs
nodev   inotifyfs
nodev   devpts
        ext3
        ext2
        squashfs
nodev   ramfs
nodev   nfs
        jffs2
nodev   rpc_pipefs

So, ext4 is not managed under Pogoplug. But it won't be a trouble.
Install normally Lenny on ext3.
Shutdown your Dockstar. Unplug the usb drive.

On your usual Desktop GNU/Linux system, plug your usb disk. Turn your ext3 fs to ext4
# tune2fs -O extents,uninit_bg,dir_index /dev/sdxn  (read carefully gives you #tail -f /var/log/message to identify your just plugged usb disk)
#e2fsck /dev/sdxn
Unplug the usb disk.

Then boot Pogoplug and set the environnement variables to ext4
fw_setenv usb_rootfstype ext4
Plug the usb disk on the Dockstar
Reboot.



Edited 3 time(s). Last edit at 09/27/2010 02:29PM by Sagittarius.
Max
Re: ext4 hard support in boot image uImage ?
September 27, 2010 02:56PM
Now that's interesting. But what are the differences between an ext4-filesystem created with mkfs.ext4 and a ext3->ext4 migrated filesystem?

I've just created two loopback devices with 100MB.
The first one got formatted with mkfs.ext3 and converted to ext4 with tune2fs like you proposed.
The second one got formatted with mkfs.ext4.

I can mount both filesystems with mount -t ext4, since ext4 seems to be downward compatible.
But i can only mount the one created with mkfs.ext3 with mount -t ext3.
So, there has to be a difference. Any ideas? ;)
Max
Re: ext4 hard support in boot image uImage ?
September 27, 2010 03:04PM
There is even a kernel error message when trying to mount the image created with mkfs.ext4:
Quote

EXT3-fs: loop0: couldn't mount because of unsupported optional features (240).
Jmandawg
Re: ext4 hard support in boot image uImage ?
October 29, 2010 11:43AM
Thanks for this post. Very weird how it won't work from a fresh ext4 format.
jmandawg
Re: ext4 hard support in boot image uImage ?
October 31, 2010 02:44PM
It doesn't seem to be working so good from the "upgraded" ext3 either. It boots and mounts as ext4 fine, but seems to be having issues reading and writing files. This is after copying a 1.5GB file to the dockstar and back to my desktop.

Oh well, back to ext3.

[  197.635613] sd 0:0:0:0: [sda] Unhandled sense code
[  197.640449] sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  197.647635] sd 0:0:0:0: [sda] Sense Key : Medium Error [current]
[  197.653802] sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error
[  197.659862] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 13 46 77 00 00 10 00
[  197.666891] end_request: I/O error, dev sda, sector 1263223
[  201.446982] sd 0:0:0:0: [sda] Unhandled sense code
[  201.451821] sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  201.459008] sd 0:0:0:0: [sda] Sense Key : Medium Error [current]
[  201.465156] sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error
[  201.471225] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 13 46 7f 00 00 08 00
[  201.478245] end_request: I/O error, dev sda, sector 1263231
[  354.199492] sd 0:0:0:0: [sda] Unhandled sense code
[  354.204327] sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  354.211521] sd 0:0:0:0: [sda] Sense Key : Medium Error [current]
[  354.217669] sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error
[  354.223738] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 13 46 3f 00 00 f0 00
[  354.230767] end_request: I/O error, dev sda, sector 1263167
[  357.988607] sd 0:0:0:0: [sda] Unhandled sense code
[  357.993444] sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  358.000622] sd 0:0:0:0: [sda] Sense Key : Medium Error [current]
[  358.006770] sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error
[  358.012839] sd 0:0:0:0: [sda] CDB: Read(10): 28 00 00 13 46 7f 00 00 08 00
[  358.019860] end_request: I/O error, dev sda, sector 1263231

Re: ext4 hard support in boot image uImage ?
November 01, 2010 04:39AM
I've been using ext4 since 2 months now without issue in the system logs.
My Dockstarr runs lighttpd mysql phpp for Dolibarr. I use also a partition for a webdavs server.

In my case, GNU/Linux Debian Lenny is installed on the external usb drive (ext4) not in the Nand memory.
jmandawg
Re: ext4 hard support in boot image uImage ?
November 01, 2010 07:20PM
Well, when i did the conversion from ext3 to ext4 i got alot of errors that were corrected when i ran this command:

#e2fsck /dev/sdg1


Is that normal?
Re: ext4 hard support in boot image uImage ?
November 02, 2010 02:42PM
Yes that's completely normal ;-) I presume you have read it in my previous post to launch #e2fsck /dev/sdxn
See : http://kernelnewbies.org/Ext4



Edited 1 time(s). Last edit at 11/02/2010 02:47PM by Sagittarius.
jmandawg
Re: ext4 hard support in boot image uImage ?
November 06, 2010 10:19PM
Has anyone gotten a cleanly formatted (mkfs.ext4) drive to boot?
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: