Intrepid: it is not possible to mount ntfs partitions from the initrd

Bug #268123 reported by Dave Morley
46
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Wubi
Fix Released
High
Colin Ian King
busybox (Ubuntu)
Fix Released
High
Colin Watson

Bug Description

RELEASE: Intrepid
CD/DVD VARIANT: Wubi-8.10-rev507.exe
ISO BUILD: 20080909

SYMPTOMS: Wubi downloads the files correctly starts the reboot process and upon reboot displays ubuntu correctly. However once started it initialises the kernel and drops into initramfs.

CAUSE: Fails to mount sda1

EDIT (ago):
The issue is more generic, ntfs partitions cannot be mounted from any 2.6.27 initrd
To reproduce, boot with break=mount and try to mount manually an ntfs partition (also in vm)
Mounting ntfs partitions from a fully booted system works well, mounting other file systems from initrd works well.

Tags: iso-testing

Related branches

Revision history for this message
Dave Morley (davmor2) wrote :
Revision history for this message
Dave Morley (davmor2) wrote :

No comments are left in verbose mode everything seems to be fine.

Revision history for this message
Agostino Russo (ago) wrote :

I can confirm that. I tried to mount the device manually.

When I use mount -t ntfs I get "No such device"
When I use mount.ntfs I get "Device or resource busy"

This happens when the host device is mounted before mounting the loop device therein

Changed in wubi:
assignee: nobody → cking
importance: Undecided → High
status: New → Confirmed
assignee: cking → colin-king
Revision history for this message
Miles Lane (miles-lane) wrote :

My issue may be unrelated.
I have been getting boot errors with the latest Intrepid kernel, but the 2.6.24 based kernel still boots. I have been trying to get my own 2.6.27-rc6 kernel to boot. At first I tried without building NTFS support into the kernel. Now I do have it compiled into vmlinux. Here is the error that seems to be cause it to drop into busybox:

[ 6.573789] NTFS-fs error (device sda2): parse_options(): Unrecognized mount option locale.

When I look in the root of the drive in the busybox ash shell, I don't see a casper.log file.

Revision history for this message
Colin Ian King (colin-king) wrote :

I've reproduced by installing Windows Vista in Virtual Box and then running the Wubi installer and booting up ubuntu I also fall into busybox initramfs.

I then mounted an ext3 file system containing some tools and was able to strace the mount, see attached log. Not sure why the mount to fuseblk is returning -EBUSY as yet.

I've tested the same ntfs-3g binary against a linux-2.6.27-2 kernel and I can mount the same partition in a normal non-Wubi installation - so ntfs-3g and linux-2.6.27-2 are OK in the normal enviroment and not in the initramfs installer environment.

Revision history for this message
Colin Ian King (colin-king) wrote :

Also, just to add, this problem is not just /dev/sda1, but any NTFS partition. Thus it's not a problem if fuse getting confused on the main NTFS partition.

Revision history for this message
Miles Lane (miles-lane) wrote :

Any suggestion how I can get this to build? I downloaded the source files from: http://packages.ubuntu.com/source/intrepid/aufs
If I am guessing correctly, must be built into my 2.6.27-rc6 kernel in order for me to boot using wubi (Intrepid)?
Perhaps I need to figure out how to build aufs into the kernel image, rather than as a module. Any help getting this working is appreciated. Then I can determine whether my custom kernel fails the same way the current Intrepid kernel does.

root@miles-laptop:/usr/src/aufs/aufs-0+20080719# make CONFIG_AUFS=m AUFS_EXTRA_CFLAGS=”-I /usr/src/aufs/aufs-0+20080719/include -I /usr/src/linux/include -DCONFIG_AUFS_FAKE_DM -DCONFIG_AUFS_BRANCH_MAX_127 -DCONFIG_AUFS_RR_SQUASHFS -DCONFIG_AUFS_MAGIC_SYSRQ -DCONFIG_AUFS_DEBUG -DCONFIG_AUFS_LOCAL -DCONFIG_AUFS_SYSAUFS -DCONFIG_AUFS_MODULE -UCONFIG_AUFS -DLKTRHidePrePath=\\\”/usr/src/aufs/aufs-0+20080719/fs/aufs25\\\”" -C /lib/modules/2.6.27-rc6/build M=/usr/src/aufs/aufs-0+20080719/fs/aufs25 modules
make: Entering directory `/usr/src/linux-2.6′
CC [M] /usr/src/aufs/aufs-0+20080719/fs/aufs25/module.o
In file included from /usr/src/aufs/aufs-0+20080719/fs/aufs25/dentry.h:35,
from /usr/src/aufs/aufs-0+20080719/fs/aufs25/aufs.h:40,
from /usr/src/aufs/aufs-0+20080719/fs/aufs25/module.c:26:
/usr/src/aufs/aufs-0+20080719/fs/aufs25/vfsub.h: In function ‘do_vfsub_permission’:
/usr/src/aufs/aufs-0+20080719/fs/aufs25/vfsub.h:215: error: implicit declaration of function ‘permission’
In file included from /usr/src/aufs/aufs-0+20080719/fs/aufs25/aufs.h:44,
from /usr/src/aufs/aufs-0+20080719/fs/aufs25/module.c:26:
/usr/src/aufs/aufs-0+20080719/fs/aufs25/inode.h: In function ‘au_security_inode_permission’:
/usr/src/aufs/aufs-0+20080719/fs/aufs25/inode.h:145: error: too many arguments to function ‘security_inode_permission’
/usr/src/aufs/aufs-0+20080719/fs/aufs25/module.c:184:2: warning: #warning CONFIG_AUFS_SYSAUFS is unnecessary for linux-2.6.25 and later.
/usr/src/aufs/aufs-0+20080719/fs/aufs25/module.c:206:2: warning: #warning CONFIG_AUFS_FAKE_DM is obsoleted in linux-2.6.24 and later.
make[1]: *** [/usr/src/aufs/aufs-0+20080719/fs/aufs25/module.o] Error 1
make: *** [_module_/usr/src/aufs/aufs-0+20080719/fs/aufs25] Error 2
make: Leaving directory `/usr/src/linux-2.6′

Revision history for this message
Colin Ian King (colin-king) wrote :

Szabolcs.

Any idea why the ntfs-3g mount via fuse is getting -EBUSY on the mount below:

[pid 2143] stat64("/dev/sda1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 1), ...}) = 0
[pid 2143] mount("/dev/sda1", "/tmp/ntfs", "fuseblk", MS_NOSUID|MS_NODEV|MS_SILENT, "allow_other,blksize=4096") = -1 EBUSY (Device or resource busy)
[pid 2143] write(2, "mount: mounting /dev/sda1 on /tm"..., 71mount: mounting /dev/sda1 on /tmp/ntfs failed: Device or resource busy
) = 71

..this is from my log above (http://launchpadlibrarian.net/17508675/strace.log)

Revision history for this message
Szabolcs Szakacsits (szaka) wrote :

From 'man 2 mount':

       EBUSY source is already mounted. Or, it cannot be remounted read-only,
              because it still holds files open for writing. Or, it cannot be
              mounted on target because target is still busy (it is the work‐
              ing directory of some task, the mount point of another device,
              has open files, etc.). Or, it could not be unmounted because it
              is busy.

But the most typical if the block device is already in used and locked by some
[other] __kernel__ subsystem.

Revision history for this message
Miles Lane (miles-lane) wrote :

Can someone confirm or deny whether aufs is used in booting Wubi? So far I am just guessing. The Wubi documentation does not make this clear, afaics.

Revision history for this message
Agostino Russo (ago) wrote :

Colin, I have tried with a standard 2.6.27-2 kernel/initrd ripped from a normal installation (without casper) stopping the boot process with break=mount and mounting manually the ntfs device but I run into the same situation. So the issue is not Wubi related.

You mentioned you can mount the ntfs partitions from an installed system, but it is not possible to mount the ntfs partition using the lib/modules within the initrd. Is there any relevant difference between fuse/ntfs in a standard setup vs the ones within the initrd?

PS Miles, Wubi uses the stock (casper) initrd and any module that comes with it, there is no wubi code calling aufs directly. Wubi specific code is under the lupin project. It might be though that casper uses aufs.

Revision history for this message
tronicum (stefan-sels) wrote :

Same problem here with an Alpha 5 on an HP2133. Will do an network or usb-cdrom install now

Revision history for this message
Agostino Russo (ago) wrote :

Szaka, re EBUSY, I do not think this has anything to do with the device being mounted and having open files, since the error happens on the very first mount operation at boot (using break), nothing else I am aware of runs "mount" before then. The target is a simple empty dir within the initrd root so it shouldn't be busy. Hence the error is confusing. Best lead so far seems to be that the situation happens when mounting an(y) ntfs file system from the initrd busybox but not from a fully booted system (someone please confirm this).

Revision history for this message
Agostino Russo (ago) wrote :

I can confirm that this is initrd-specific for 2.6.27-2
Adding initramfs-tools

Changed in initramfs-tools:
importance: Undecided → High
status: New → Confirmed
Agostino Russo (ago)
description: updated
description: updated
Revision history for this message
Colin Watson (cjwatson) wrote :

The strace shows the same filesystem being mounted twice:

mount("/dev/sda1", "/tmp/ntfs", "fuseblk", MS_NOSUID|MS_NODEV, "allow_other,blksize=4096,fd=4,ro"...) = 0
[...]
clone(Process 2143 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7d91b28) = 2143
[...]
[pid 2143] execve("/bin/mount", ["/bin/mount", "-i", "-f", "-t", "fuseblk", "-o", "rw,nosuid,nodev,allow_other,blks"..., "/dev/sda1", "/tmp/ntfs"], [/* 33 vars */]) = 0
[...]
[pid 2143] mount("/dev/sda1", "/tmp/ntfs", "fuseblk", MS_NOSUID|MS_NODEV|MS_SILENT, "allow_other,blksize=4096") = -1 EBUSY (Device or resource busy)

This is probably the source of the problem. Looks like /bin/mount in the initramfs is ignoring the -f flag ("fake", don't actually call mount(8)).

Revision history for this message
Colin Watson (cjwatson) wrote :

I'll upload a busybox fix shortly. I can't easily test this, but I think it should do the job; let me know whether it fixes it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package busybox - 1:1.10.2-1ubuntu5

---------------
busybox (1:1.10.2-1ubuntu5) intrepid; urgency=low

  * debian/config/config.*: Enable 'mount -f' across the board, needed by
    FUSE filesystems (LP: #268123).

 -- Colin Watson <email address hidden> Thu, 11 Sep 2008 09:51:27 +0100

Changed in busybox:
status: Confirmed → Fix Released
Colin Watson (cjwatson)
Changed in busybox:
assignee: nobody → kamion
Revision history for this message
Miles Lane (miles-lane) wrote :

I tested with this package installed: busybox-initramfs 1:1.10.2-1ubuntu5
When I attempt to boot linux-image-2.6.27-2-generic I still drop down into busybox with the following error:

mount: mounting /dev/disk/by-uuid/06D06A1FD06A1569 on /root failed: no such device

If I then attempt to boot using kernel 2.6.24-21, the boot completes with no problems.

Revision history for this message
Miles Lane (miles-lane) wrote :
Download full text (3.4 KiB)

Perhaps the issue I am seeing with 2.6.27 kernels is different from the busybox/initrd issue fixed here. I get the messages below during the setup of the drives on my machine. Is the kernel failing to set up my drives correctly? One clue is that it looks as though perhaps BOTH pata_acpi and ata_piix are trying to handle the hard drives interface??? I am also puzzled by the line "sda:<6>ata5.00: ATAPI: Optiarc DVD RW AD-7530A", which seems to indicate that sda is somehow getting confused with my DVD-RW drive.

I tried mounting partitions from my drive from the command line and all attempts gave the same error: "device not found".

[ 4.459717] ata1: SATA max UDMA/133 abar m1024@0xd8444400 port 0xd8444500 irq 2301
[ 4.459720] ata2: DUMMY
[ 4.459723] ata3: SATA max UDMA/133 abar m1024@0xd8444400 port 0xd8444600 irq 2301
[ 4.459726] ata4: DUMMY
[ 5.056152] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 5.057177] ata1.00: ACPI cmd ef/10:03:00:00:00:a0 filtered out
[ 5.057342] ata1.00: ATA-7: Hitachi HTS541616J9SA00, SB4OC70P, max UDMA/100
[ 5.057345] ata1.00: 312581808 sectors, multi 16: LBA48 NCQ (depth 31/32)
[ 5.058519] ata1.00: ACPI cmd ef/10:03:00:00:00:a0 filtered out
[ 5.058686] ata1.00: configured for UDMA/100
[ 5.392129] ata3: SATA link down (SStatus 0 SControl 300)
[ 5.408396] scsi 0:0:0:0: Direct-Access ATA Hitachi HTS54161 SB4O PQ: 0 ANSI: 5
[ 5.464760] pata_acpi 0000:00:1f.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19
[ 5.464798] pata_acpi 0000:00:1f.1: setting latency timer to 64
[ 5.464821] pata_acpi 0000:00:1f.1: PCI INT B disabled
[ 5.468055] ata_piix 0000:00:1f.1: version 2.12
[ 5.468065] ata_piix 0000:00:1f.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19
[ 5.468109] ata_piix 0000:00:1f.1: setting latency timer to 64
[ 5.468195] scsi4 : ata_piix
[ 5.468273] scsi5 : ata_piix
[ 5.469015] ata5: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x1810 irq 14
[ 5.469019] ata6: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x1818 irq 15
[ 5.478018] Driver 'sd' needs updating - please use bus_type methods
[ 5.478163] sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)
[ 5.478192] sd 0:0:0:0: [sda] Write Protect is off
[ 5.478195] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 5.478240] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 5.478344] sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)
[ 5.478369] sd 0:0:0:0: [sda] Write Protect is off
[ 5.478372] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 5.478418] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 5.478423] sda:<6>ata5.00: ATAPI: Optiarc DVD RW AD-7530A, EX32, max UDMA/33
[ 5.648451] ata5.00: configured for UDMA/33
[ 5.648503] ata6: port disabled. ignoring.
[ 5.648548] isa bounce pool size: 16 pages
[ 5.649976] scsi 4:0:0:0: CD-ROM Optiarc DVD RW AD-7530A EX32 PQ: 0 ANSI: 5
[ 5.661100] Driver 'sr' needs updating - please use bus_type methods
[ 5.879315] sda1 sda2
[ 5.879493] sd 0:0:0:0: [sda] Attached SCSI disk
[ 5.886208] sd...

Read more...

Revision history for this message
Miles Lane (miles-lane) wrote :

I got the following reply from someone on the Linux Kernel Mailing List:

"There doesn't seem like there's anything wrong here, the /dev/sda device should be available. Unless there's some kind of udev problem or something that's screwing up the device nodes.."

So, any suggestions how I can debug this?

Revision history for this message
Agostino Russo (ago) wrote :

Using busybox - 1:1.10.2-1ubuntu5:

mount -t ntfs -> no such device
mount.ntfs -> OK

Revision history for this message
Agostino Russo (ago) wrote :

It seems to work well with busybox 1:1.10.2-1ubuntu6

Changed in wubi:
status: Confirmed → Fix Released
Revision history for this message
Miles Lane (miles-lane) wrote :

The latest build works for me as well. Also, regarding my issue with my 2.6.27-rc6 kernel, I built a new version with more drivers built as modules and can boot the resulting kernel. I guess the initrd had to have more modules in it to make it possible for busybox to mount my NTFS partitions.

Thanks,
        Miles

Revision history for this message
Agostino Russo (ago) wrote :

Miles,

That shouldn't be the case, can you please open a new bug report (subscribe me in) listing the modules you think are missing so that we can investigate?

Thanks,

Ago

tags: added: iso-testing
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.