Comment 1 for bug 711799

Revision history for this message
Ian! D. Allen (idallen) wrote :

Same error, different circumstances:

# fsck.ext4 /dev/sde1
e2fsck 1.41.12 (17-May-2010)
fsck.ext4: Group descriptors look bad... trying backup blocks...
fsck.ext4: Bad magic number in super-block when using the backup blocks
fsck.ext4: going back to original superblock
fsck.ext4: Device or resource busy while trying to open /dev/sde1
Filesystem mounted or opened exclusively by another program?

The bug above is that the program opens /dev/sde1 once, forgets to close it,
then tries to open it a second time and fails. Found with strace:

[...]
write(1, "fsck.ext4: Group descriptors loo"..., 65) = 65
close(3) = 0
munmap(0x7f7d658b7000, 483328) = 0
open("/dev/sde1", O_RDWR|O_EXCL) = 3
ioctl(3, BLKROGET, 0x7fffe00b6bfc) = 0
uname({sys="Linux", node="idallen-oak.home.idallen.ca", ...}) = 0
lseek(3, 134217728, SEEK_SET) = 134217728
read(3, "a%\20\217\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 1024
write(2, "fsck.ext4", 9) = 9
write(2, ": ", 2) = 2
write(2, "Bad magic number in super-block", 31) = 31
write(2, " ", 1) = 1
write(2, "when using the backup blocks", 28) = 28
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "\n", 1) = 1
write(1, "fsck.ext4: going back to origina"..., 45) = 45
open("/dev/sde1", O_RDWR|O_EXCL) = -1 EBUSY (Device or resource busy)
write(2, "fsck.ext4", 9) = 9
write(2, ": ", 2) = 2
write(2, "Device or resource busy", 23) = 23
write(2, " ", 1) = 1
write(2, "while trying to open /dev/sde1", 30) = 30
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(2, "\n", 1) = 1
write(1, "Filesystem mounted or opened exc"..., 61) = 61
exit_group(8) = ?