<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>2064</bug_id>
          
          <creation_ts>2012-03-08 09:42:37 +0000</creation_ts>
          <short_desc>[BSP] mount shows &quot;/dev/sda4 on /media/sda4&quot; but /media/sda4 doesn&apos;t exist</short_desc>
          <delta_ts>2013-06-12 23:43:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>1.5 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dexuan Cui">dexuan.cui</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>corneliux.stoicescu</cc>
    
    <cc>dvhart</cc>
    
    <cc>hongxu.jia</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</cc>
    
    <cc>zhenfeng.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>18904</commentid>
    <comment_count>0</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2012-03-08 09:42:37 +0000</bug_when>
    <thetext>This issue happens to BSP only.
After a BSP board is booted with Yocto linux from USB drive, &quot;mount&quot; shows:

/dev/sda4 on /media/sda4 type vfat (rw,sync,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

but actually the directory /media/sda4 doesn&apos;t exist at all.

BTW, if the USB disk is created with dd directly, the above &quot;sda4&quot; will be &quot;sda&quot; only, and the directory /media/sda doesn&apos;t exist at all.

Ps, the disk is mounted by &apos;sync&apos; option -- this is really rather slow. I think we should mount it as &quot;async&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19157</commentid>
    <comment_count>1</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-03-15 22:18:52 +0000</bug_when>
    <thetext>I believe this is because the mount data comes from proc setup during early boot before the change root, which then uses a different root filesystem.

We mount with sync because it is removable media and not using sync is dangerous. If you care about performance, you shouldn&apos;t be booting from a USB drive anyway. I suggest running an install from the live image, rather than using the live image as the final boot image.

As this is not a functional failure, but rather an ambiguous status report from mount, I&apos;m dropping in priority.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19158</commentid>
    <comment_count>2</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-03-15 22:19:44 +0000</bug_when>
    <thetext>Waiting for a response from Dexuan, but we may just close this. But first, let me know why this is a problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19164</commentid>
    <comment_count>3</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2012-03-16 01:45:58 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; I believe this is because the mount data comes from proc setup during early
&gt; boot before the change root, which then uses a different root filesystem.

&quot;mount&quot; shows: /dev/sda4 on /media/sda4 type vfat
but /media/sda4 doesn&apos;t exist at all. I think this would confuse a user?
If this mounting is intended and can&apos;t be fixed easily, can we at least create the directory /media/sda4? 

&gt; 
&gt; We mount with sync because it is removable media and not using sync is
&gt; dangerous.
I agree.

&gt;  If you care about performance, you shouldn&apos;t be booting from a USB
&gt; drive anyway.
I mostly agree.

However, I can give some data: I have a USB drive that can be read at 15 MB/s and be written at 5MB/s.
However, with the sync option, looks the speed is far slower than 1MB/s.
This can cause pretty slow IO response sometimes when I write a few files -- the   shell can hang for 1~2 minutes until the IO finishes...

If I mkdir /media/sda4 and mount -o remount,async, the IO speed will become normal.

I&apos;m not sure if this is an issue.
If this is intended, I can understand and close the bug. :-)

&gt; I suggest running an install from the live image, rather than
&gt; using the live image as the final boot image.
I agree.

&gt; 
&gt; As this is not a functional failure, but rather an ambiguous status report from
&gt; mount, I&apos;m dropping in priority.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19223</commentid>
    <comment_count>4</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-03-19 16:16:22 +0000</bug_when>
    <thetext>One potential option here would be to bind mount the boot /media/* mount points into the chroot fs prior to chroot&apos;ing to it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20897</commentid>
    <comment_count>5</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-04-27 00:33:13 +0000</bug_when>
    <thetext>This has additional side effects as well. I worked with a customer today who mounted the boot device (mmcblk0 in this case) to /mnt. It was already mounted on /media/mmcblk0, but that wasn&apos;t visible. They then mounted the rootfs.img to make a change (since union fs appears to prevent persistent storage). They unmounted the rootfs.img loop mount. Then tried to unmount /mnt/ It failed with a &quot;device or resource busy&quot; error. I suspect something is getting crossed up with mmcblk0 being mounted twice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20900</commentid>
    <comment_count>6</comment_count>
    <who name="Dexuan Cui">dexuan.cui</who>
    <bug_when>2012-04-27 02:09:33 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; This has additional side effects as well. I worked with a customer today who
&gt; mounted the boot device (mmcblk0 in this case) to /mnt. It was already mounted
&gt; on /media/mmcblk0, but that wasn&apos;t visible. They then mounted the rootfs.img to
&gt; make a change (since union fs appears to prevent persistent storage). They
&gt; unmounted the rootfs.img loop mount. Then tried to unmount /mnt/ It failed with
&gt; a &quot;device or resource busy&quot; error. I suspect something is getting crossed up
&gt; with mmcblk0 being mounted twice.

Hi Darren,
I got the same  &quot;device or resource busy&quot; error recently -- previously(I meant maybe 2 months ago) I didn&apos;t get this error when I tried  &quot;mount -o remount,async&quot; as I described in Comment 3.

I think there must be something changed recently.
(Sorry, at present I have no time to look into that)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>29222</commentid>
    <comment_count>7</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-01-28 02:54:59 +0000</bug_when>
    <thetext>merged into poky/master: f8a4a74c8cd69de2b3332526e1110ff745fb824d

http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/live-image-move-media</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33653</commentid>
    <comment_count>8</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-06-06 05:42:54 +0000</bug_when>
    <thetext>*env
Build Configuration:
BB_VERSION        = &quot;1.19.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;Ubuntu-12.10&quot;
TARGET_SYS        = &quot;i586-poky-linux&quot;
MACHINE           = &quot;emenlow-noemgd&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;1.4+snapshot-20130605&quot;
TUNE_FEATURES     = &quot;m32 core2&quot;
TARGET_FPU        = &quot;&quot;
meta              
meta-yocto        
meta-yocto-bsp    = &quot;hongxu-0530-udev:5cb59cc6910d8f3165528c4a71e29e4de897d242&quot;
meta-intel        
meta-emenlow      = &quot;master:2ba2e0ea55bab687134b452a5db81d189b820f59&quot;

*problem
Test them on Emenlow. Machine has internal SSD with sda1/sda2/sda3 partition on it.
After the BSP board is booted with Yocto linux from USB drive, &quot;cat /proc/mounts&quot; shows:
...
/dev/sda3 /media/sda3 ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
/dev/sda1 /media/sda1 ext3 rw,relatime,errors=continue,barrier=1,data=ordered 0 0
/dev/sda2 /media/sda2 ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
...

but actually the directory /media/sda1 doesn&apos;t exist at all, &quot;df&quot; shows:
...
df: /media/sda3: No such file or directory
df: /media/sda1: No such file or directory
df: /media/sda2: No such file or directory
...

*analysis
This is because the mount data comes from proc setup during early boot before the change root, which then uses a different root filesystem, the media is not in the new root filesystem.

*solution
Plan 1, During early boot before switch_root, unmount any medias which mounted by udev&apos;s automounter could fix this issue, after switch_root to make the new root filesystem and start init process, the newer udev will detect and automount them again.

Plan 2, During early boot before switch_root, use `mount --move&apos; to move the medias to the new root filesystem could also fix this issue. 

I have tested both, and Plan 2 is better, cause it only needs automounter once, and Plan 1 could not umount the real root media in which the target is busy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33873</commentid>
    <comment_count>9</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2013-06-12 23:43:12 +0000</bug_when>
    <thetext>Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=66079795c9eaec1a7ae376b25d91eea14e6498b7</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>