mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Barebox and ext4 ? problems
@ 2017-08-14 16:31 Holger Schurig
  2017-08-14 17:36 ` Ian Abbott
  2017-08-16  6:15 ` Simon Aittamaa
  0 siblings, 2 replies; 5+ messages in thread
From: Holger Schurig @ 2017-08-14 16:31 UTC (permalink / raw)
  To: barebox

Hi,

i just noticed that Barebox 2017.08.0 has trouble with one of my ext4
partitions. My i.mX6q device has both SD-Card and eMMC. Normally I boot
from SD-Card, and then from there I use normal "fdisk" / "mkfs.ext4 -F
-j -L $label /dev/$dev" to create the ext4 partitions. Then I mount this
and rsync the contents of the SD-Card into the eMMC partition.

Now, when I boot into Barebox, I can't access the /boot device. Look at
the weird flags:

barebox:/ detect mmc3 
barebox:/ mkdir /mnt
barebox:/ mount /dev/mmc3.0 /mnt/
barebox:/ ll /mnt
drwxrwxrwx              0 .
drwxrwxrwx              0 ..
?---------              0 bin
?---------              0 boot
?---------              0 dev
drwxr-xr-x           4096 etc
lrwxrwxrwx              9 home -> /opt/home
drwxr-xr-x           4096 lib
drwx------          16384 lost+found
drwxr-xr-x           4096 media
?---------              0 mnt
?---------              0 opt
?---------              0 proc
drwxr-xr-x           4096 root
drwxr-xr-x           4096 run
drwxr-xr-x           4096 sbin
?---------              0 srv
?---------              0 sys
?---------              0 tmp
drwxr-xr-x           4096 usr
drwxr-xr-x           4096 var


So, some directories like "boot" aren't directories. Moreover, some
directories that I can access have the wrong contents:

barebox:/ ll /mnt/media/media
drwxr-xr-x           4096 .
drwxrwxrwx              0 ..
crw-r-----              0 console
lrwxrwxrwx             11 core -> /proc/kcore
lrwxrwxrwx             14 fd -> /proc/self/fd/
crw-rw-rw-              0 full
crw-r-----              0 kmem
brw-r-----              0 loop0
brw-r-----              0 loop1
brw-r-----              0 loop2
brw-r-----              0 loop3
brw-r-----              0 loop4
brw-r-----              0 loop5
brw-r-----              0 loop6
brw-r-----              0 loop7
...

/media should however be empty, not contain files from /dev !!!



The SD-Card however is correct:

barebox:/ umount /mnt
barebox:/ detect mmc1
barebox:/ mount /dev/mmc1.0 /mnt/
barebox:/ ll /mnt/
drwxrwxrwx              0 .
drwxrwxrwx              0 ..
drwxr-xr-x           4096 bin
drwxr-xr-x           1024 boot
drwxr-xr-x           1024 dev
drwxr-xr-x           5120 etc
lrwxrwxrwx              9 home -> /opt/home
drwxr-xr-x           1024 lib
drwxr-xr-x           1024 media
drwxr-xr-x           1024 mnt
drwxr-xr-x           1024 opt
drwxr-xr-x           1024 proc
drwx------           1024 root
drwxr-xr-x           1024 run
drwxr-xr-x           3072 sbin
drwxr-xr-x           1024 srv
drwxr-xr-x           1024 sys
drwxrwxrwt           1024 tmp
drwxr-xr-x           1024 usr
drwxr-xr-x           1024 var

(also the /media there is empty). Similarly, when I mount the eMMC from
Linux, I also get the correct files:

root@my:~# mount /dev/mmcblk0p1 /mnt/
root@my:~# ll /mnt/
total 84
drwxr-xr-x  2 root root  4096 Aug 14 14:57 bin/
drwxr-xr-x  2 root root  4096 Aug 14 15:38 boot/
drwxr-xr-x  3 root root  4096 Aug 14 14:56 dev/
drwxr-xr-x 58 root root  4096 Aug 14 15:38 etc/
lrwxrwxrwx  1 root root     9 Aug 14 15:37 home -> /opt/home/
drwxr-xr-x 11 root root  4096 Aug 14 14:56 lib/
drwx------  2 root root 16384 Aug 14 16:07 lost+found/
drwxr-xr-x  3 root root  4096 Sep 30  2016 media/
drwxr-xr-x  2 root root  4096 Sep 30  2016 mnt/
drwxr-xr-x  2 root root  4096 Aug 14 14:58 opt/
drwxr-xr-x  2 root root  4096 Sep 30  2016 proc/
drwx------  4 root root  4096 Aug 14 15:01 root/
drwxr-xr-x  3 root root  4096 Aug 14 14:58 run/
drwxr-xr-x  2 root root  4096 Aug 14 15:02 sbin/
drwxr-xr-x  2 root root  4096 Sep 30  2016 srv/
drwxr-xr-x  2 root root  4096 Sep 30  2016 sys/
drwxrwxrwt  2 root root  4096 Aug 14 15:53 tmp/
drwxr-xr-x 10 root root  4096 Sep 30  2016 usr/
drwxr-xr-x 11 root root  4096 Sep 30  2016 var/


Questions:

* Did Linux 4.9.x or e2fsprogs 1.42.12-2+b1 from Debian Stretch use some
  partition flags / format that Barebox 2017.08.0 doesn't support?
* any ideas on how to debug this further?


Greetings,
Holger

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Barebox and ext4 ? problems
  2017-08-14 16:31 Barebox and ext4 ? problems Holger Schurig
@ 2017-08-14 17:36 ` Ian Abbott
  2017-08-16  6:15 ` Simon Aittamaa
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Abbott @ 2017-08-14 17:36 UTC (permalink / raw)
  To: barebox

On 14/08/17 17:31, Holger Schurig wrote:
> Hi,
> 
> i just noticed that Barebox 2017.08.0 has trouble with one of my ext4
> partitions. My i.mX6q device has both SD-Card and eMMC. Normally I boot
> from SD-Card, and then from there I use normal "fdisk" / "mkfs.ext4 -F
> -j -L $label /dev/$dev" to create the ext4 partitions. Then I mount this
> and rsync the contents of the SD-Card into the eMMC partition.
> 
> Now, when I boot into Barebox, I can't access the /boot device. Look at
> the weird flags:
> 
> barebox:/ detect mmc3
> barebox:/ mkdir /mnt
> barebox:/ mount /dev/mmc3.0 /mnt/
> barebox:/ ll /mnt
> drwxrwxrwx              0 .
> drwxrwxrwx              0 ..
> ?---------              0 bin
> ?---------              0 boot
> ?---------              0 dev
> drwxr-xr-x           4096 etc
> lrwxrwxrwx              9 home -> /opt/home
> drwxr-xr-x           4096 lib
> drwx------          16384 lost+found
> drwxr-xr-x           4096 media
> ?---------              0 mnt
> ?---------              0 opt
> ?---------              0 proc
> drwxr-xr-x           4096 root
> drwxr-xr-x           4096 run
> drwxr-xr-x           4096 sbin
> ?---------              0 srv
> ?---------              0 sys
> ?---------              0 tmp
> drwxr-xr-x           4096 usr
> drwxr-xr-x           4096 var
> 
> 
> So, some directories like "boot" aren't directories. Moreover, some
> directories that I can access have the wrong contents:
> 
> barebox:/ ll /mnt/media/media
> drwxr-xr-x           4096 .
> drwxrwxrwx              0 ..
> crw-r-----              0 console
> lrwxrwxrwx             11 core -> /proc/kcore
> lrwxrwxrwx             14 fd -> /proc/self/fd/
> crw-rw-rw-              0 full
> crw-r-----              0 kmem
> brw-r-----              0 loop0
> brw-r-----              0 loop1
> brw-r-----              0 loop2
> brw-r-----              0 loop3
> brw-r-----              0 loop4
> brw-r-----              0 loop5
> brw-r-----              0 loop6
> brw-r-----              0 loop7
> ...
> 
> /media should however be empty, not contain files from /dev !!!
> 
> 
> 
> The SD-Card however is correct:
> 
> barebox:/ umount /mnt
> barebox:/ detect mmc1
> barebox:/ mount /dev/mmc1.0 /mnt/
> barebox:/ ll /mnt/
> drwxrwxrwx              0 .
> drwxrwxrwx              0 ..
> drwxr-xr-x           4096 bin
> drwxr-xr-x           1024 boot
> drwxr-xr-x           1024 dev
> drwxr-xr-x           5120 etc
> lrwxrwxrwx              9 home -> /opt/home
> drwxr-xr-x           1024 lib
> drwxr-xr-x           1024 media
> drwxr-xr-x           1024 mnt
> drwxr-xr-x           1024 opt
> drwxr-xr-x           1024 proc
> drwx------           1024 root
> drwxr-xr-x           1024 run
> drwxr-xr-x           3072 sbin
> drwxr-xr-x           1024 srv
> drwxr-xr-x           1024 sys
> drwxrwxrwt           1024 tmp
> drwxr-xr-x           1024 usr
> drwxr-xr-x           1024 var
> 
> (also the /media there is empty). Similarly, when I mount the eMMC from
> Linux, I also get the correct files:
> 
> root@my:~# mount /dev/mmcblk0p1 /mnt/
> root@my:~# ll /mnt/
> total 84
> drwxr-xr-x  2 root root  4096 Aug 14 14:57 bin/
> drwxr-xr-x  2 root root  4096 Aug 14 15:38 boot/
> drwxr-xr-x  3 root root  4096 Aug 14 14:56 dev/
> drwxr-xr-x 58 root root  4096 Aug 14 15:38 etc/
> lrwxrwxrwx  1 root root     9 Aug 14 15:37 home -> /opt/home/
> drwxr-xr-x 11 root root  4096 Aug 14 14:56 lib/
> drwx------  2 root root 16384 Aug 14 16:07 lost+found/
> drwxr-xr-x  3 root root  4096 Sep 30  2016 media/
> drwxr-xr-x  2 root root  4096 Sep 30  2016 mnt/
> drwxr-xr-x  2 root root  4096 Aug 14 14:58 opt/
> drwxr-xr-x  2 root root  4096 Sep 30  2016 proc/
> drwx------  4 root root  4096 Aug 14 15:01 root/
> drwxr-xr-x  3 root root  4096 Aug 14 14:58 run/
> drwxr-xr-x  2 root root  4096 Aug 14 15:02 sbin/
> drwxr-xr-x  2 root root  4096 Sep 30  2016 srv/
> drwxr-xr-x  2 root root  4096 Sep 30  2016 sys/
> drwxrwxrwt  2 root root  4096 Aug 14 15:53 tmp/
> drwxr-xr-x 10 root root  4096 Sep 30  2016 usr/
> drwxr-xr-x 11 root root  4096 Sep 30  2016 var/
> 
> 
> Questions:
> 
> * Did Linux 4.9.x or e2fsprogs 1.42.12-2+b1 from Debian Stretch use some
>    partition flags / format that Barebox 2017.08.0 doesn't support?
> * any ideas on how to debug this further?
> 
> 
> Greetings,
> Holger

You could use tune2fs -l DEV to check for differences in filesystem 
features between the two filesystems.  That might narrow down where the 
problem lies.

mke2fs uses the /etc/mke2fs.conf file to set the default features when 
creating the filesystem, so you might need to modify that to make the 
defaults compatible with barebox.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Barebox and ext4 ? problems
  2017-08-14 16:31 Barebox and ext4 ? problems Holger Schurig
  2017-08-14 17:36 ` Ian Abbott
@ 2017-08-16  6:15 ` Simon Aittamaa
  2017-08-16  8:27   ` Holger Schurig
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Aittamaa @ 2017-08-16  6:15 UTC (permalink / raw)
  To: Holger Schurig; +Cc: barebox

Hello,

I've run into this problem myself. As you suspect e2fsprogs did add a
flag that isn't supported by barebox, I think it was metadata_csum and
64bit... I have the notes/script at work (and still on
summer-vacation) so can't give you an exact answer, but if you
generate a file-system with the older version of the tools and then
the newer version and check the flags (tune2fs -l <dev> if my memory
serves me correctly) to see which flags are active for each of the
file-systems.

Or just disable metadata_csum and 64bit and see if it works!

Best,
Simon

On 14 August 2017 at 18:31, Holger Schurig <holgerschurig@gmail.com> wrote:
> Hi,
>
> i just noticed that Barebox 2017.08.0 has trouble with one of my ext4
> partitions. My i.mX6q device has both SD-Card and eMMC. Normally I boot
> from SD-Card, and then from there I use normal "fdisk" / "mkfs.ext4 -F
> -j -L $label /dev/$dev" to create the ext4 partitions. Then I mount this
> and rsync the contents of the SD-Card into the eMMC partition.
>
> Now, when I boot into Barebox, I can't access the /boot device. Look at
> the weird flags:
>
> barebox:/ detect mmc3
> barebox:/ mkdir /mnt
> barebox:/ mount /dev/mmc3.0 /mnt/
> barebox:/ ll /mnt
> drwxrwxrwx              0 .
> drwxrwxrwx              0 ..
> ?---------              0 bin
> ?---------              0 boot
> ?---------              0 dev
> drwxr-xr-x           4096 etc
> lrwxrwxrwx              9 home -> /opt/home
> drwxr-xr-x           4096 lib
> drwx------          16384 lost+found
> drwxr-xr-x           4096 media
> ?---------              0 mnt
> ?---------              0 opt
> ?---------              0 proc
> drwxr-xr-x           4096 root
> drwxr-xr-x           4096 run
> drwxr-xr-x           4096 sbin
> ?---------              0 srv
> ?---------              0 sys
> ?---------              0 tmp
> drwxr-xr-x           4096 usr
> drwxr-xr-x           4096 var
>
>
> So, some directories like "boot" aren't directories. Moreover, some
> directories that I can access have the wrong contents:
>
> barebox:/ ll /mnt/media/media
> drwxr-xr-x           4096 .
> drwxrwxrwx              0 ..
> crw-r-----              0 console
> lrwxrwxrwx             11 core -> /proc/kcore
> lrwxrwxrwx             14 fd -> /proc/self/fd/
> crw-rw-rw-              0 full
> crw-r-----              0 kmem
> brw-r-----              0 loop0
> brw-r-----              0 loop1
> brw-r-----              0 loop2
> brw-r-----              0 loop3
> brw-r-----              0 loop4
> brw-r-----              0 loop5
> brw-r-----              0 loop6
> brw-r-----              0 loop7
> ...
>
> /media should however be empty, not contain files from /dev !!!
>
>
>
> The SD-Card however is correct:
>
> barebox:/ umount /mnt
> barebox:/ detect mmc1
> barebox:/ mount /dev/mmc1.0 /mnt/
> barebox:/ ll /mnt/
> drwxrwxrwx              0 .
> drwxrwxrwx              0 ..
> drwxr-xr-x           4096 bin
> drwxr-xr-x           1024 boot
> drwxr-xr-x           1024 dev
> drwxr-xr-x           5120 etc
> lrwxrwxrwx              9 home -> /opt/home
> drwxr-xr-x           1024 lib
> drwxr-xr-x           1024 media
> drwxr-xr-x           1024 mnt
> drwxr-xr-x           1024 opt
> drwxr-xr-x           1024 proc
> drwx------           1024 root
> drwxr-xr-x           1024 run
> drwxr-xr-x           3072 sbin
> drwxr-xr-x           1024 srv
> drwxr-xr-x           1024 sys
> drwxrwxrwt           1024 tmp
> drwxr-xr-x           1024 usr
> drwxr-xr-x           1024 var
>
> (also the /media there is empty). Similarly, when I mount the eMMC from
> Linux, I also get the correct files:
>
> root@my:~# mount /dev/mmcblk0p1 /mnt/
> root@my:~# ll /mnt/
> total 84
> drwxr-xr-x  2 root root  4096 Aug 14 14:57 bin/
> drwxr-xr-x  2 root root  4096 Aug 14 15:38 boot/
> drwxr-xr-x  3 root root  4096 Aug 14 14:56 dev/
> drwxr-xr-x 58 root root  4096 Aug 14 15:38 etc/
> lrwxrwxrwx  1 root root     9 Aug 14 15:37 home -> /opt/home/
> drwxr-xr-x 11 root root  4096 Aug 14 14:56 lib/
> drwx------  2 root root 16384 Aug 14 16:07 lost+found/
> drwxr-xr-x  3 root root  4096 Sep 30  2016 media/
> drwxr-xr-x  2 root root  4096 Sep 30  2016 mnt/
> drwxr-xr-x  2 root root  4096 Aug 14 14:58 opt/
> drwxr-xr-x  2 root root  4096 Sep 30  2016 proc/
> drwx------  4 root root  4096 Aug 14 15:01 root/
> drwxr-xr-x  3 root root  4096 Aug 14 14:58 run/
> drwxr-xr-x  2 root root  4096 Aug 14 15:02 sbin/
> drwxr-xr-x  2 root root  4096 Sep 30  2016 srv/
> drwxr-xr-x  2 root root  4096 Sep 30  2016 sys/
> drwxrwxrwt  2 root root  4096 Aug 14 15:53 tmp/
> drwxr-xr-x 10 root root  4096 Sep 30  2016 usr/
> drwxr-xr-x 11 root root  4096 Sep 30  2016 var/
>
>
> Questions:
>
> * Did Linux 4.9.x or e2fsprogs 1.42.12-2+b1 from Debian Stretch use some
>   partition flags / format that Barebox 2017.08.0 doesn't support?
> * any ideas on how to debug this further?
>
>
> Greetings,
> Holger
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Barebox and ext4 ? problems
  2017-08-16  6:15 ` Simon Aittamaa
@ 2017-08-16  8:27   ` Holger Schurig
  2017-08-16  8:31     ` Lucas Stach
  0 siblings, 1 reply; 5+ messages in thread
From: Holger Schurig @ 2017-08-16  8:27 UTC (permalink / raw)
  To: barebox

Simon Aittamaa <simon.aittamaa@gmail.com> writes:

> I think it was metadata_csum and 64bit...

You're right.

My SDCard was formatted months ago, I only used rsync for the updates.
But the eMMC was formatted afresh by a script from me. I found out with
the feature command "debugfs" that the partitions have different
features enables. In my case it was only 64bit, not metadata_csum.

I now use

	mkfs.ext4 -O ^64bit -F -j -L $label /dev/mmcblk0p$partition

to format it. It spits out some ugly warning that 64bit is the best
thing since sliced bread, but if you ignore this, then everything is
fine!

To get rid of this uglyness, I use:

	mkfs.ext4 -O ^64bit -F -j -L $label /dev/mmcblk0p$partition | \
		grep -v 64-bit | \
		grep -v 64bit

I think I'll post a patch to Barebox that either allows it to mount
partions with the 64bit feature. Or to refuse the mount with a proper
error message.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Barebox and ext4 ? problems
  2017-08-16  8:27   ` Holger Schurig
@ 2017-08-16  8:31     ` Lucas Stach
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2017-08-16  8:31 UTC (permalink / raw)
  To: Holger Schurig; +Cc: barebox

Hi Holger,

Am Mittwoch, den 16.08.2017, 10:27 +0200 schrieb Holger Schurig:
> Simon Aittamaa <simon.aittamaa@gmail.com> writes:
> 
> > I think it was metadata_csum and 64bit...
> 
> You're right.
> 
> My SDCard was formatted months ago, I only used rsync for the updates.
> But the eMMC was formatted afresh by a script from me. I found out with
> the feature command "debugfs" that the partitions have different
> features enables. In my case it was only 64bit, not metadata_csum.
> 
> I now use
> 
> 	mkfs.ext4 -O ^64bit -F -j -L $label /dev/mmcblk0p$partition
> 
> to format it. It spits out some ugly warning that 64bit is the best
> thing since sliced bread, but if you ignore this, then everything is
> fine!
> 
> To get rid of this uglyness, I use:
> 
> 	mkfs.ext4 -O ^64bit -F -j -L $label /dev/mmcblk0p$partition | \
> 		grep -v 64-bit | \
> 		grep -v 64bit
> 
> I think I'll post a patch to Barebox that either allows it to mount
> partions with the 64bit feature. Or to refuse the mount with a proper
> error message.

That would be much appreciated.

Regards,
Lucas


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-16  8:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14 16:31 Barebox and ext4 ? problems Holger Schurig
2017-08-14 17:36 ` Ian Abbott
2017-08-16  6:15 ` Simon Aittamaa
2017-08-16  8:27   ` Holger Schurig
2017-08-16  8:31     ` Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox