Bug 3705

Summary: Existing filesystems aren't cleanly unmounted after booting from USB-drive
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Maksym Zhelieznyi <mv.zhelieznyi>
Component: coreAssignee: Hongxu Jia <hongxu.jia>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Low CC: alexandru.c.georgescu, corneliux.stoicescu, hongxu.jia, liezhi.yang, mark.hatle, meta.mr.watcher, meta.watcher, Qi.Chen, sgw, yi.zhao, zhenfeng.zhao
Version: unspecified   
Target Milestone: 1.5 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Maksym Zhelieznyi 2013-01-11 13:58:10 UTC
Problem was found on Crownbay. Machine has internal SSD with sda1 partition on it.
HDDIMG is written on USB using dd utility.

Main problem that after automounting sda1 on early boot stage and chrooting, sytem can not unmount filesystem cleanly and it causes recovery procedure for sda1 when we boot next time.
Steps to reproduce:
- boot system from USB-drive
- reboot system
Result:
Output for "dmesg | grep 'recovery'" command:
  EXT3-fs (sda1): recovery compete

In case when system is booted from USB, command 'mount' shows that sda1 are mounted in /media/sda1:
  /dev/sda1 on /media/sda1 type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered)

But access to /media/sda1 fails as well as unmounting it (umount: can't umount /media/sda1: Invalid argument). If execute command "mount /dev/sda1 /media/sda1" we can see it mounted and 'mount' command shows string "/dev/sda1 on /media/sda1 type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered)" two times. After unmounting mounted filesystem one string still in 'mount' output. 
fstab doesn't contain sda1.

This is cause of that next booting of system from USB can takes up to 5 minutes if some information has been copied onto the mounted sda1.


related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=2064
Comment 1 Darren Hart 2013-01-16 16:43:18 UTC
Yes, this is basically the same problem with changing the mount namespace with the chroot as described in Bug 2064 as you noted.
Comment 2 Chen Qi 2013-01-28 02:55:07 UTC
merged into poky/master: f8a4a74c8cd69de2b3332526e1110ff745fb824d

http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/live-image-move-media
Comment 3 Stoicescu Cornel 2013-04-17 12:38:05 UTC
AlexG, can you verify this on next full pass? Thanks :)
Comment 4 Alexandru Georgescu 2013-04-17 12:53:55 UTC
(In reply to comment #3)
> AlexG, can you verify this on next full pass? Thanks :)

Ok
Comment 5 Hongxu Jia 2013-06-06 05:45:10 UTC
related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=2064