Windows not found unless partition is mounted

Bug #1051306 reported by Todd Bradshaw on 2012-09-15
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Critical
Colin Watson
Quantal
Critical
Colin Watson

Bug Description

todd@todd-laptop:~$ sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xafc76067

   Device Boot Start End Blocks Id System
/dev/sda1 63 80324 40131 de Dell Utility
/dev/sda2 * 81920 501379071 250648576 7 HPFS/NTFS/exFAT
/dev/sda3 501381118 625141759 61880321 5 Extended
/dev/sda5 501381120 509769727 4194304 82 Linux swap / Solaris
/dev/sda6 509771776 530251775 10240000 83 Linux
/dev/sda7 530253824 625141759 47443968 83 Linux

mount
/dev/sda6 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
/dev/sda7 on /home type ext4 (rw)
gvfsd-fuse on /home/todd/.gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=todd)

todd@todd-laptop:~$ sudo os-prober
todd@todd-laptop:~$ sudo mount -t auto /dev/sda1 /media/dell_util/
todd@todd-laptop:~$ sudo mount -t auto /dev/sda2 /media/windows/
todd@todd-laptop:~$ sudo os-prober
/dev/sda2:Windows 7 (loader):Windows:chain

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: os-prober 1.54ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-14.19-generic 3.5.3
Uname: Linux 3.5.0-14-generic x86_64
ApportVersion: 2.5.1-0ubuntu7
Architecture: amd64
Date: Sat Sep 15 10:34:16 2012
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: os-prober
UpgradeStatus: No upgrade log present (probably fresh install)

Todd Bradshaw (snooptodd) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in os-prober (Ubuntu):
status: New → Confirmed
Steve Langasek (vorlon) wrote :

Since os-prober failures can leave the user with no way to get back to Windows and possibly no way to reach the Internet to find out how to fix the problem (depending on network driver availability), it's important that bugs like this be fixed before release.

Can the users who are seeing this problem check whether it was reproducible with 12.04 LTS?

Changed in os-prober (Ubuntu Quantal):
importance: Undecided → Critical
milestone: none → ubuntu-12.10
assignee: nobody → Dmitrijs Ledkovs (xnox)
jose (o1485726) wrote :

I got exactly the same issue.

root@machine:/# bash -x /usr/bin/os-prober
+ set -e
+ . /usr/share/os-prober/common.sh
++ cleanup_tmpdir=false
++ cleanup_ro_partitions=
++ progname=
++ type mapdevfs
+ newns
+ '[' '' ']'
+ exec /usr/lib/os-prober/newns /usr/bin/os-prober
/dev/sda1:Windows 7 (loader):Windows:chain
root@machine:/# umount /mnt/hda1
root@machine:/# bash -x /usr/bin/os-prober
+ set -e
+ . /usr/share/os-prober/common.sh
++ cleanup_tmpdir=false
++ cleanup_ro_partitions=
++ progname=
++ type mapdevfs
+ newns
+ '[' '' ']'
+ exec /usr/lib/os-prober/newns /usr/bin/os-prober
(no output)

I don't know what newns does.

Dimitri John Ledkov (xnox) wrote :

@ jose thanks for this output.

Todd Bradshaw (snooptodd) wrote :

I had 12.04 32 bit installed on this laptop before installing 12.10 64 bit. os-prober worked correctly in 12.04.

jose (o1485726) wrote :

ran this command before and after mounting the partition (/dev/sda1 in /mnt/hda1):
# OS_PROBER_NEWNS=1 bash -x /usr/bin/os-prober
attached is the output (modified a bit to make easy to diff the files, and deleted my username).

jose (o1485726) wrote :

second attachment...

Colin Watson (cjwatson) wrote :

os-prober is very chatty in the syslog, and this may be more useful than these (incomplete, I'm afraid) set -x dumps. Could you perhaps extract the syslog messages emitted by a run of os-prober?

summary: - windows not found unless partion is mounted
+ Windows not found unless partition is mounted
Dimitri John Ledkov (xnox) wrote :

What's the output of:

   sudo blkid -o value -s TYPE /dev/sda2

where /dev/sda2 is the windows partition in question?

Todd Bradshaw (snooptodd) wrote :

todd@todd-Latitude-E6420:~$ sudo blkid -o value -s TYPE /dev/sda2
ntfs

Dimitri John Ledkov (xnox) wrote :

os-prober tries hard to determine types of the filesystem, and mounts using those only. From the logs it appears that it failed it's attempts at mounting the "windows" partition in question. Maybe os-prober should fallback to 'auto' type, and then use that... but then 20microsoft uses the passed type as a sanity check. hmm....

Dimitri John Ledkov (xnox) wrote :

Now this is a long shot, but can you do this:

$ sudo mount -t auto /dev/sda2 /mnt
$ ls -la /mnt
$ sudo umount /mnt
$ sudo grub-mount /dev/sda2 /mnt
$ ls -la /mnt
$ sudo umount /mnt

Hopefully both ls calls are identical....

Todd Bradshaw (snooptodd) wrote :

todd@todd-Latitude-E6420:~$ sudo mount -t auto /dev/sda2 /media/Windows/
todd@todd-Latitude-E6420:~$ sudo os-prober
/dev/sda2:Windows 7 (loader):Windows:chain

Colin Watson (cjwatson) wrote :

So, I can't reproduce this here with my test copy of Windows 7, unfortunately. If I could then this would be a lot easier.

I suspect that GRUB's NTFS driver (we use GRUB's filesystem drivers so that we can do true read-only mounts, without running the risk of replaying journals or similar) is failing to handle your filesystem. Please could we have the output of:

  sudo grub-mount /dev/sda2 /mnt
  sudo ls -l /mnt
  sudo ls -l /mnt/boot
  sudo umount /mnt

Todd Bradshaw (snooptodd) wrote :
Download full text (3.6 KiB)

Not the same.

todd@todd-Latitude-E6420:~$ sudo mount -t auto /dev/sda2 /mnt
todd@todd-Latitude-E6420:~$ ls -la /mnt
total 5811870
drwxrwxrwx 1 root root 16384 Oct 11 13:17 .
drwxr-xr-x 24 root root 4096 Oct 12 08:07 ..
-rwxrwxrwx 1 root root 24 Jun 10 2009 autoexec.bat
drwxrwxrwx 1 root root 4096 Oct 26 2011 BBH_Software
drwxrwxrwx 1 root root 0 May 8 21:18 BHFILES
drwxrwxrwx 1 root root 8192 Sep 15 23:30 Boot
-rwxrwxrwx 1 root root 383786 Nov 20 2010 bootmgr
drwxrwxrwx 1 root root 16384 Oct 11 13:17 Config.Msi
-rwxrwxrwx 1 root root 10 Jun 10 2009 config.sys
drwxrwxrwx 1 root root 0 Sep 16 17:38 dell
lrwxrwxrwx 2 root root 60 Jul 14 2009 Documents and Settings -> /mnt/Users
drwxrwxrwx 1 root root 0 Oct 25 2011 Drivers
-rwxrwxrwx 1 root root 558835 Sep 17 10:28 drivers.log
-rwxrwxrwx 2 root root 17734 Nov 7 2007 eula.1028.txt
-rwxrwxrwx 2 root root 17734 Nov 7 2007 eula.1031.txt
-rwxrwxrwx 2 root root 10134 Nov 7 2007 eula.1033.txt
-rwxrwxrwx 2 root root 17734 Nov 7 2007 eula.1036.txt
-rwxrwxrwx 2 root root 17734 Nov 7 2007 eula.1040.txt
-rwxrwxrwx 2 root root 118 Nov 7 2007 eula.1041.txt
-rwxrwxrwx 2 root root 17734 Nov 7 2007 eula.1042.txt
-rwxrwxrwx 2 root root 17734 Nov 7 2007 eula.2052.txt
-rwxrwxrwx 2 root root 17734 Nov 7 2007 eula.3082.txt
-rwxrwxrwx 2 root root 1853 Oct 26 2011 freefallprotection.log
-rwxrwxrwx 1 root root 1110 Nov 7 2007 globdata.ini
-rwxrwxrwx 1 root root 2548744192 Oct 11 16:33 hiberfil.sys
drwxrwxrwx 1 root root 0 Oct 25 2011 Hotfix
-rwxrwxrwx 1 root root 562688 Nov 7 2007 install.exe
-rwxrwxrwx 1 root root 843 Nov 7 2007 install.ini
-rwxrwxrwx 2 root root 76304 Nov 7 2007 install.res.1028.dll
-rwxrwxrwx 2 root root 96272 Nov 7 2007 install.res.1031.dll
-rwxrwxrwx 2 root root 91152 Nov 7 2007 install.res.1033.dll
-rwxrwxrwx 2 root root 97296 Nov 7 2007 install.res.1036.dll
-rwxrwxrwx 2 root root 95248 Nov 7 2007 install.res.1040.dll
-rwxrwxrwx 2 root root 81424 Nov 7 2007 install.res.1041.dll
-rwxrwxrwx 2 root root 79888 Nov 7 2007 install.res.1042.dll
-rwxrwxrwx 2 root root 75792 Nov 7 2007 install.res.2052.dll
-rwxrwxrwx 2 root root 96272 Nov 7 2007 install.res.3082.dll
drwxrwxrwx 1 root root 0 Sep 16 17:39 Intel
-rwxrwxrwx 1 root root 0 Jan 31 2012 IO.SYS
-rwxrwxrwx 1 root root 0 Jan 31 2012 MSDOS.SYS
drwxrwxrwx 1 root root 0 Oct 26 2011 MSOCache
-rwxrwxrwx 1 root root 3398328320 Oct 11 16:33 pagefile.sys
drwxrwxrwx 1 root root 0 Jul 13 2009 PerfLogs
drwxrwxrwx 1 root root 4096 Oct 11 16:40 ProgramData
drwxrwxrwx 1 root root 20480 Oct 11 13:17 Program Files
drwxrwxrwx 1 root root 0 Oct 26 2011 Recovery
drwxrwxrwx 1 root root 0 Sep 16 17:41 $Recycle.Bin
drwxrwxrwx 1 root root 4096 Jan 11 2012 System Volume Information
drwxrwxrwx 1 root root 0 Oct 11 16:37 Temp
drwxrwxrwx 1 root root 0 Sep 29 16:23 .Tras...

Read more...

Dimitri John Ledkov (xnox) wrote :

@ snooptodd

Can you do all of this as root for the grub-mount? above. Sorry didn't realise grub-mount is that protective.

Todd Bradshaw (snooptodd) wrote :

sudo ls -la /mnt doesnt give the correct result either.

grub_mount syslog
Oct 12 09:04:03 todd-Latitude-E6420 ntfs-3g[4042]: Version 2012.1.15AR.5 external FUSE 29
Oct 12 09:04:03 todd-Latitude-E6420 ntfs-3g[4042]: Mounted /dev/sda2 (Read-Write, label "", NTFS 3.1)
Oct 12 09:04:03 todd-Latitude-E6420 ntfs-3g[4042]: Cmdline options: rw
Oct 12 09:04:03 todd-Latitude-E6420 ntfs-3g[4042]: Mount options: rw,allow_other,nonempty,relatime,fsname=/dev/sda2,blkdev,blksize=4096
Oct 12 09:04:03 todd-Latitude-E6420 ntfs-3g[4042]: Ownership and permissions disabled, configuration type 7

todd@todd-Latitude-E6420:~$ sudo grub-mount /dev/sda2 /mnt
todd@todd-Latitude-E6420:~$ mount
/dev/sda6 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
/dev/sda7 on /home type ext4 (rw)
gvfsd-fuse on /run/user/todd/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=todd)
grub-mount on /mnt type fuse.grub-mount (rw,nosuid,nodev)
todd@todd-Latitude-E6420:~$ sudo umount /mnt

Colin Watson (cjwatson) wrote :

You still haven't actually given me the output of 'sudo ls -l /mnt'. Please could you run the *exact* sequence of commands I gave, with no variation, and show the output of those?

Todd Bradshaw (snooptodd) wrote :

@Colin Watson
todd@todd-Latitude-E6420:~$ sudo grub-mount /dev/sda2 /mnt
todd@todd-Latitude-E6420:~$ sudo ls -l /mnt
total 0
todd@todd-Latitude-E6420:~$ sudo ls -l /mnt/boot
ls: cannot access /mnt/boot: No such file or directory
todd@todd-Latitude-E6420:~$ sudo umount /mnt
todd@todd-Latitude-E6420:~$

@Dmitrijs Ledkovs
Is comment 18 good enough or do u want to see the output?

Colin Watson (cjwatson) wrote :

Ooh. Well, I may not have been able to reproduce on my test machine, but on my normal development laptop, 'sudo grub-mount /dev/sda5 /mnt' results in an empty /mnt, where /dev/sda5 is my root partition and is certainly not empty. Oh dear. Investigating.

affects: os-prober (Ubuntu Quantal) → grub2 (Ubuntu Quantal)
Changed in grub2 (Ubuntu Quantal):
assignee: Dmitrijs Ledkovs (xnox) → Colin Watson (cjwatson)
status: Confirmed → Triaged
Colin Watson (cjwatson) wrote :

I can also reproduce this with upstream trunk; and have verified that it's not present in precise.

tags: added: regression-release
Colin Watson (cjwatson) wrote :

My current belief is that this bug is triggered by the presence of a symlink to a directory.

Colin Watson (cjwatson) on 2012-10-12
Changed in grub2 (Ubuntu Quantal):
status: Triaged → In Progress
jose (o1485726) wrote :

From syslog (added some context, windows partition is sda1):

Not mounted:
macosx-prober: debug: /dev/sda1 is not an HFS+ partition: exiting
50mounted-tests: debug: running subtest /usr/lib/os-probes/mounted/20microsoft
20microsoft: debug: /dev/sda1 is a NTFS partition
50mounted-tests: debug: running subtest /usr/lib/os-probes/mounted/30utility
30utility: debug: /dev/sda1 is not a FAT partition: exiting
50mounted-tests: debug: running subtest /usr/lib/os-probes/mounted/40lsb
50mounted-tests: debug: running subtest /usr/lib/os-probes/mounted/70hurd
50mounted-tests: debug: running subtest /usr/lib/os-probes/mounted/80minix
50mounted-tests: debug: running subtest /usr/lib/os-probes/mounted/83haiku
83haiku: debug: /dev/sda1 is not a BeFS partition: exiting
50mounted-tests: debug: running subtest /usr/lib/os-probes/mounted/90linux-distro
50mounted-tests: debug: running subtest /usr/lib/os-probes/mounted/90solaris
os-prober: debug: running /usr/lib/os-probes/50mounted-tests on /dev/sda3

Mounting:
ntfs-3g[32246]: Version 2012.1.15AR.5 external FUSE 29
ntfs-3g[32246]: Mounted /dev/sda1 (Read-Write, label "", NTFS 3.1)
ntfs-3g[32246]: Cmdline options: rw,noatime,nodiratime,uid=1000,gid=1000,umask=017,nls=utf8
ntfs-3g[32246]: Mount options: rw,nodiratime,nls=utf8,allow_other,nonempty,noatime,default_permissions,fsname=/dev/sda1,blkdev,blksize=4096
ntfs-3g[32246]: Global ownership and permissions enforced, configuration type 7

Mounted:
macosx-prober: debug: /dev/sda1 is not an HFS+ partition: exiting
os-prober: debug: running /usr/lib/os-probes/mounted/20microsoft on mounted /dev/sda1
20microsoft: debug: /dev/sda1 is a FUSE partition
20microsoft: result: /dev/sda1:Windows 7 (loader):Windows:chain
os-prober: debug: os detected by /usr/lib/os-probes/mounted/20microsoft
os-prober: debug: running /usr/lib/os-probes/50mounted-tests on /dev/sda3

Note that when the partition is not mounted, it says NTFS, and continues the tests, so the error is there.

Colin Watson (cjwatson) on 2012-10-12
Changed in grub2 (Ubuntu Quantal):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.00-7ubuntu10

---------------
grub2 (2.00-7ubuntu10) quantal; urgency=low

  * Ignore symlink traversal failures in grub-mount readdir (LP: #1051306).
 -- Colin Watson <email address hidden> Fri, 12 Oct 2012 17:14:04 +0100

Changed in grub2 (Ubuntu Quantal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers