update-grub creates duplicate ubuntu entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
os-prober (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
On my laptop update-grub creates duplicate Ubuntu entries. First created by update-grub itself, second added by os-prober. It doesn't happen on other laptops, only on my ASUS Zenbook UX301LAA. Here's os-prober output:
$ sudo os-prober
/dev/mapper/
/dev/mapper/
On my other (older) laptop os-prober only outputs Windows entry.
ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: grub (not installed)
ProcVersionSign
Uname: Linux 3.19.0-18-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
CurrentDesktop: Unity
Date: Sun Jun 7 00:48:40 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-05-06 (31 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
SourcePackage: grub
UpgradeStatus: No upgrade log present (probably fresh install)
affects: | grub (Ubuntu) → grub2 (Ubuntu) |
I found why it happens. The problem is how os-prober resolves UUID-mounted partitions. It uses `readlink -f`. And it works in most cases, but on my system it works like that:
$ readlink -f /dev/disk/ by-uuid/ b7c815db- eefe-4e08- 8d62-0c68531fa8 ca
/dev/dm-7
So UUID resolved to /dev/dm-7 instead of isw_dahhdhgec_ ASUS_OS7, so os-prober didn't test if this partition is actually mounted as '/'.