mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* automount doesn't work without GPT table
@ 2025-02-27  6:37 Alexander Shiyan
  2025-02-27 17:00 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Shiyan @ 2025-02-27  6:37 UTC (permalink / raw)
  To: Barebox List

Hello All.

I found that automounting does not work without a GPT table.
In the example below, it is not possible to automatically mount a
partition from an MMC card.
However, if I add the full paths to the command manually, everything works.

barebox 2025.02.0-00690-ga6a0a0ba4f61 #12 Thu Feb 27 08:27:56 MSK 2025
Board: Mega-Milas MM-SM-SAMA5D2
AT91: Detected soc type: sama5d2
AT91: Detected soc subtype: sama5d27c_d1g
...
sdhci-at91 b0000000.sdio-host@b0000000.of: registered as mmc1
mmc1: detected SD card version 2.0
mmc1: registered mmc1
...
barebox@Mega-Milas Informer SAMA5D2:/ ls /mnt/mmc1.0
mount: Device or resource busy
running automount command 'mount mmc1.0' failed
ls: No such device

barebox@Mega-Milas Informer SAMA5D2:/ automount -l
/mnt/mmc1            mount mmc1
/mnt/mmc1.0          mount mmc1.0
/mnt/mmc1.1          mount mmc1.1
/mnt/tftp            ifup -a1 && mount -t tftp $global.net.server /mnt/tftp
/mnt/nfs             ifup -a1 && mount -t nfs
${global.net.server}:/home/${global.user}/nfsroot/${global.hostname}
/mnt/nfs
/mnt/ratp            mount -t ratpfs none /mnt/ratp

barebox@Mega-Milas Informer SAMA5D2:/ automount /mnt/mmc1.0  "mount
/dev/mmc1.0 /mnt/mmc1.0"
barebox@Mega-Milas Informer SAMA5D2:/ ls /mnt/mmc1.0
BOOT.BIN           barebox.bin        barebox.env        rootfs.squashfs

With the GPT table on the MMC, everything works OK out of the box:

sdhci-at91 b0000000.sdio-host@b0000000.of: registered as mmc1
mmc1: detected SD card version 2.0
WARNING: mmc1: GPT:Primary header thinks Alt. header is not at the end
of the disk.
WARNING: mmc1: GPT:395303 != 60440575
WARNING: mmc1: GPT:Alternate GPT header not at the end of the disk.
WARNING: mmc1: GPT:395303 != 60440575
WARNING: mmc1: GPT: Use parted to correct GPT errors.
mmc1: registered mmc1
...

barebox@Mega-Milas Informer SAMA5D2:/ ls /mnt/mmc1.0
mounted /dev/mmc1.0 on /mnt/mmc1.0
BOOT.BIN           barebox.bin        barebox.env        rootfs.squashfs



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

* Re: automount doesn't work without GPT table
  2025-02-27  6:37 automount doesn't work without GPT table Alexander Shiyan
@ 2025-02-27 17:00 ` Sascha Hauer
  2025-02-28  6:06   ` Alexander Shiyan
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2025-02-27 17:00 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: Barebox List

Hi ALexander,

On Thu, Feb 27, 2025 at 09:37:37AM +0300, Alexander Shiyan wrote:
> Hello All.
> 
> I found that automounting does not work without a GPT table.

So you mean it doesn't work when the device has a MBR instead of a GPT?

> In the example below, it is not possible to automatically mount a
> partition from an MMC card.
> However, if I add the full paths to the command manually, everything works.
> 
> barebox 2025.02.0-00690-ga6a0a0ba4f61 #12 Thu Feb 27 08:27:56 MSK 2025
> Board: Mega-Milas MM-SM-SAMA5D2
> AT91: Detected soc type: sama5d2
> AT91: Detected soc subtype: sama5d27c_d1g
> ...
> sdhci-at91 b0000000.sdio-host@b0000000.of: registered as mmc1
> mmc1: detected SD card version 2.0
> mmc1: registered mmc1
> ...
> barebox@Mega-Milas Informer SAMA5D2:/ ls /mnt/mmc1.0
> mount: Device or resource busy

-EBUSY is a strange error code from mount(). Can you follow where it
comes from?

I can't reproduce it here. I tried both with a MBR and a GPT.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* Re: automount doesn't work without GPT table
  2025-02-27 17:00 ` Sascha Hauer
@ 2025-02-28  6:06   ` Alexander Shiyan
  2025-02-28  8:05     ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Shiyan @ 2025-02-28  6:06 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

Hello Sascha.

The error occurs in the cdev_mount_default() function.
cdev_get_mount_path() returns "/boot".
And indeed, the partition is mounted here for some reason...
I don't understand yet why this happens.

barebox@Mega-Milas Informer SAMA5D2:/ mount
none on / type ramfs
none on /dev type devfs
/dev/mmc1.0 on /boot type fat

Update:
I found that this happens if the CONFIG_OF_BAREBOX_ENV_IN_FS option is used.
When disabled, mounting occurs as expected, but in this case I cannot
use environments from a file from a partition on the SD card.
It is not yet clear how to get out of this situation...

Thanks!

чт, 27 февр. 2025 г. в 20:01, Sascha Hauer <s.hauer@pengutronix.de>:
>
> Hi ALexander,
>
> On Thu, Feb 27, 2025 at 09:37:37AM +0300, Alexander Shiyan wrote:
> > Hello All.
> >
> > I found that automounting does not work without a GPT table.
>
> So you mean it doesn't work when the device has a MBR instead of a GPT?
>
> > In the example below, it is not possible to automatically mount a
> > partition from an MMC card.
> > However, if I add the full paths to the command manually, everything works.
> >
> > barebox 2025.02.0-00690-ga6a0a0ba4f61 #12 Thu Feb 27 08:27:56 MSK 2025
> > Board: Mega-Milas MM-SM-SAMA5D2
> > AT91: Detected soc type: sama5d2
> > AT91: Detected soc subtype: sama5d27c_d1g
> > ...
> > sdhci-at91 b0000000.sdio-host@b0000000.of: registered as mmc1
> > mmc1: detected SD card version 2.0
> > mmc1: registered mmc1
> > ...
> > barebox@Mega-Milas Informer SAMA5D2:/ ls /mnt/mmc1.0
> > mount: Device or resource busy
>
> -EBUSY is a strange error code from mount(). Can you follow where it
> comes from?
>
> I can't reproduce it here. I tried both with a MBR and a GPT.
>
> Sascha
>
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* Re: automount doesn't work without GPT table
  2025-02-28  6:06   ` Alexander Shiyan
@ 2025-02-28  8:05     ` Sascha Hauer
  2025-02-28  8:18       ` Alexander Shiyan
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2025-02-28  8:05 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: Barebox List

On Fri, Feb 28, 2025 at 09:06:55AM +0300, Alexander Shiyan wrote:
> Hello Sascha.
> 
> The error occurs in the cdev_mount_default() function.
> cdev_get_mount_path() returns "/boot".
> And indeed, the partition is mounted here for some reason...
> I don't understand yet why this happens.
> 
> barebox@Mega-Milas Informer SAMA5D2:/ mount
> none on / type ramfs
> none on /dev type devfs
> /dev/mmc1.0 on /boot type fat
> 
> Update:
> I found that this happens if the CONFIG_OF_BAREBOX_ENV_IN_FS option is used.
> When disabled, mounting occurs as expected, but in this case I cannot
> use environments from a file from a partition on the SD card.
> It is not yet clear how to get out of this situation...

Ok, so the partition is already mounted for the environment to /boot, so
you get -EBUSY when trying to automount it somewhere else.

The question arises why you want to access it via automount when you
already mounted it for your environment.

Anyway, maybe we can do better by just mounting the partition to its
standard location the autmount would use anyway and just create a
symlink from /boot to /mnt/mmc1.0. I just sent a patch for this, you
could give it a try.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* Re: automount doesn't work without GPT table
  2025-02-28  8:05     ` Sascha Hauer
@ 2025-02-28  8:18       ` Alexander Shiyan
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Shiyan @ 2025-02-28  8:18 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

Hello.

> > The error occurs in the cdev_mount_default() function.
> > cdev_get_mount_path() returns "/boot".
> > And indeed, the partition is mounted here for some reason...
> > I don't understand yet why this happens.
> >
> > barebox@Mega-Milas Informer SAMA5D2:/ mount
> > none on / type ramfs
> > none on /dev type devfs
> > /dev/mmc1.0 on /boot type fat
> >
> > Update:
> > I found that this happens if the CONFIG_OF_BAREBOX_ENV_IN_FS option is used.
> > When disabled, mounting occurs as expected, but in this case I cannot
> > use environments from a file from a partition on the SD card.
> > It is not yet clear how to get out of this situation...
>
> Ok, so the partition is already mounted for the environment to /boot, so
> you get -EBUSY when trying to automount it somewhere else.
>
> The question arises why you want to access it via automount when you
> already mounted it for your environment.

Mounting the FULL partition with the environment file to /boot was a
surprise to me :)
I just expected the usual behavior of the automount command.

Thanks!



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

end of thread, other threads:[~2025-02-28  8:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-27  6:37 automount doesn't work without GPT table Alexander Shiyan
2025-02-27 17:00 ` Sascha Hauer
2025-02-28  6:06   ` Alexander Shiyan
2025-02-28  8:05     ` Sascha Hauer
2025-02-28  8:18       ` Alexander Shiyan

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