udev wrongly shows a filesystem for mmcblk*

Bug #313313 reported by Paul Natsuo Kishimoto on 2009-01-02
2
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
Undecided
Unassigned
util-linux (Ubuntu)
Undecided
Unassigned

Bug Description

I am running Ubuntu 8.10 on an Acer Aspire One. It has two JMicron card slots; one SD(HC)-only for storage expansion; one multipurpose. I am using the expansion slot and getting odd behaviour.

I formatted a 16 GB SDHC card with a single ext2 partition:
=====
# fdisk /dev/mmcblk1
Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e extended
   p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-490448, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-490448, default 490448): 490448
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
# mkfs.ext2 -m 0 /dev/mmcblk1p1
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
981120 inodes, 3923582 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4018143232
120 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
=====

When I remove the card and reinsert it, I get a number of popup errors from Nautilus, and eventually I can see *TWO* "16.1 GB Media" entries in Nautilus. One is mounted, the other is not. Some "dmesg" output is attached. From "mount", the only relevant line is the last one:

/dev/mmcblk1p1 on /media/disk type ext2 (rw,nosuid,nodev,uhelper=hal)

I know that for hard disks, /dev/sda represents the device, and /dev/sda1 /dev/sda2 etc. are the partitions. By analogy /dev/mmcblk1 should be the device, and /dev/mmcblk1p1 should be the partition. I *THINK* the problem is that something is telling the rest of the system that /dev/mmcblk1 contains a filesystem, when it does not:

# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2009-01-02 12:41 145ebf0d-ebda-4fbc-adda-bb4b3f136e73 -> ../../sda1
lrwxrwxrwx 1 root root 15 2009-01-02 15:40 1ea31820-33a2-416e-ad4e-6df9891ecc5a -> ../../mmcblk1p1
lrwxrwxrwx 1 root root 13 2009-01-02 15:40 f18cb298-7354-40ba-8299-33c15e95b671 -> ../../mmcblk1

I have also attached the output of
$ udevadm info --query=all --name=/dev/mmcblk1
$ udevadm info --query=all --name=/dev/mmcblk1p1

All of this seems to indicate that I have two ext2 filesystems with different UUIDs on the card, when I only created one.

Please let me know what other information I can provide to help debug this error.

Paul Natsuo Kishimoto (khaeru) wrote :
Paul Natsuo Kishimoto (khaeru) wrote :
Paul Natsuo Kishimoto (khaeru) wrote :
Paul Natsuo Kishimoto (khaeru) wrote :

When creating partitions, you should always take care to zero out the first few blocks where filesystem metadata exists.

dd if=/dev/zero of=PARTITION bs=1k count=1 is usually sufficient

Changed in udev (Ubuntu):
status: New → Invalid
affects: linux (Ubuntu) → util-linux (Ubuntu)
Changed in util-linux (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers