* CD-ROM can't be ejected
@ 2004-09-15 22:25 Bc. Michal Semler
[not found] ` <c93051e804091517017ff9f29f@mail.gmail.com>
2004-09-16 7:09 ` Jens Axboe
0 siblings, 2 replies; 23+ messages in thread
From: Bc. Michal Semler @ 2004-09-15 22:25 UTC (permalink / raw)
To: linux-kernel
Hi,
it's almost half a year, when I filled this bug report:
http://bugme.osdl.org/show_bug.cgi?id=2951
and it still don't work :)
Can anybody help me?
Thanks
Michal
^ permalink raw reply [flat|nested] 23+ messages in thread[parent not found: <c93051e804091517017ff9f29f@mail.gmail.com>]
* Re: CD-ROM can't be ejected [not found] ` <c93051e804091517017ff9f29f@mail.gmail.com> @ 2004-09-16 6:55 ` Bc. Michal Semler 0 siblings, 0 replies; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 6:55 UTC (permalink / raw) To: linux-kernel No, it is not that problem :((( Any other idea? M. Dne čt 16. září 2004 02:01 Edward Angelo Dayao napsal(a): > ha... well there's a way around it... sometimes the cdrom won't eject > because you're still accessing it. > > try leaving that directory (including all terminals, nautilus > windows,etc.) ... and then eject. > > hope this helps > > edward > > On Thu, 16 Sep 2004 00:25:35 +0200, Bc. Michal Semler <cijoml@volny.cz> wrote: > > Hi, > > > > it's almost half a year, when I filled this bug report: > > http://bugme.osdl.org/show_bug.cgi?id=2951 > > > > and it still don't work :) > > > > Can anybody help me? > > > > Thanks > > > > Michal > > - > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" > > in the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-15 22:25 CD-ROM can't be ejected Bc. Michal Semler [not found] ` <c93051e804091517017ff9f29f@mail.gmail.com> @ 2004-09-16 7:09 ` Jens Axboe 2004-09-16 7:18 ` Bc. Michal Semler 1 sibling, 1 reply; 23+ messages in thread From: Jens Axboe @ 2004-09-16 7:09 UTC (permalink / raw) To: Bc. Michal Semler; +Cc: linux-kernel On Thu, Sep 16 2004, Bc. Michal Semler wrote: > Hi, > > it's almost half a year, when I filled this bug report: > http://bugme.osdl.org/show_bug.cgi?id=2951 > > and it still don't work :) > > Can anybody help me? strace -o some_file eject /dev/hdc and send some_file in here. -- Jens Axboe ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 7:09 ` Jens Axboe @ 2004-09-16 7:18 ` Bc. Michal Semler 2004-09-16 7:36 ` Jens Axboe 0 siblings, 1 reply; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 7:18 UTC (permalink / raw) To: linux-kernel [-- Attachment #1: Type: text/plain, Size: 618 bytes --] notas:/home/cijoml# mount /cdrom/ notas:/home/cijoml# umount /cdrom/ notas:/home/cijoml# strace -o eject /dev/hdc eject: unable to eject, last error: Nepřípustný argument As you can see, I dont't enter to directory... And output is included M. Dne čt 16. září 2004 09:09 jste napsal(a): > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > Hi, > > > > it's almost half a year, when I filled this bug report: > > http://bugme.osdl.org/show_bug.cgi?id=2951 > > > > and it still don't work :) > > > > Can anybody help me? > > strace -o some_file eject /dev/hdc > > and send some_file in here. [-- Attachment #2: eject --] [-- Type: text/plain, Size: 6934 bytes --] execve("/usr/bin/eject", ["eject", "/cdrom/"], [/* 30 vars */]) = 0 uname({sys="Linux", node="notas", ...}) = 0 brk(0) = 0x804e000 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=44185, ...}) = 0 old_mmap(NULL, 44185, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340X\1"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=1279044, ...}) = 0 old_mmap(NULL, 1289356, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40023000 old_mmap(0x40153000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12f000) = 0x40153000 old_mmap(0x4015c000, 7308, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4015c000 close(3) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4015e000 set_thread_area({entry_number:-1 -> 6, base_addr:0x4015e2a0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 munmap(0x40018000, 44185) = 0 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=293184, ...}) = 0 mmap2(NULL, 293184, PROT_READ, MAP_PRIVATE, 3, 0) = 0x4015f000 close(3) = 0 brk(0) = 0x804e000 brk(0x806f000) = 0x806f000 brk(0) = 0x806f000 access("/cdrom", F_OK) = 0 readlink("/cdrom", 0xbfffea70, 4095) = -1 EINVAL (Invalid argument) stat64("/cdrom", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open("/etc/mtab", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=266, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x401a7000 read(3, "/dev/hda2 / ext3 rw,errors=remou"..., 4096) = 266 stat64("/dev/hda2", {st_mode=S_IFBLK|0660, st_rdev=makedev(3, 2), ...}) = 0 stat64("proc", 0xbfffed5c) = -1 ENOENT (No such file or directory) stat64("sysfs", 0xbfffed5c) = -1 ENOENT (No such file or directory) stat64("devpts", 0xbfffed5c) = -1 ENOENT (No such file or directory) stat64("tmpfs", 0xbfffed5c) = -1 ENOENT (No such file or directory) stat64("usbfs", 0xbfffed5c) = -1 ENOENT (No such file or directory) stat64("/dev/hda1", {st_mode=S_IFBLK|0660, st_rdev=makedev(3, 1), ...}) = 0 stat64("none", 0xbfffed5c) = -1 ENOENT (No such file or directory) read(3, "", 4096) = 0 close(3) = 0 munmap(0x401a7000, 4096) = 0 open("/etc/fstab", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=576, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x401a7000 read(3, "# /etc/fstab: static file system"..., 4096) = 576 close(3) = 0 munmap(0x401a7000, 4096) = 0 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/gconv/gconv-modules", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=45278, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x401a7000 read(3, "# GNU libc iconv configuration.\n"..., 4096) = 4096 read(3, ".B1.002//\nalias\tJS//\t\t\tJUS_I.B1."..., 4096) = 4096 read(3, "859-3\t1\nmodule\tINTERNAL\t\tISO-885"..., 4096) = 4096 read(3, "9-14//\nalias\tLATIN8//\t\tISO-8859-"..., 4096) = 4096 read(3, "CSEBCDICES//\t\tEBCDIC-ES//\nalias\t"..., 4096) = 4096 read(3, "IBM284//\nalias\tEBCDIC-CP-ES//\t\tI"..., 4096) = 4096 read(3, "ias\t864//\t\t\tIBM864//\nalias\tCSIBM"..., 4096) = 4096 read(3, "\tIBM937\t\t1\nmodule\tINTERNAL\t\tIBM9"..., 4096) = 4096 read(3, "UC-JP//\nmodule\tEUC-JP//\t\tINTERNA"..., 4096) = 4096 read(3, "143IECP271//\tIEC_P27-1//\nalias\tI"..., 4096) = 4096 read(3, "\nmodule\tINTERNAL\t\tISO_10367-BOX/"..., 4096) = 4096 read(3, "\t\tto\t\t\tmodule\t\tcost\nmodule\tShift"..., 4096) = 222 read(3, "", 4096) = 0 close(3) = 0 munmap(0x401a7000, 4096) = 0 open("/usr/lib/gconv/ISO8859-2.so", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\6\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=7744, ...}) = 0 old_mmap(NULL, 10684, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x401a7000 old_mmap(0x401a9000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x401a9000 close(3) = 0 open("/etc/mtab", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=266, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x401aa000 read(3, "/dev/hda2 / ext3 rw,errors=remou"..., 4096) = 266 read(3, "", 4096) = 0 close(3) = 0 munmap(0x401aa000, 4096) = 0 open("/dev/hdc", O_RDONLY|O_NONBLOCK) = 3 ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO (Input/output error) ioctl(3, FIBMAP, 0xbffff970) = 0 ioctl(3, FIBMAP, 0xbffff970) = 0 ioctl(3, FIBMAP, 0xbffff970) = 0 ioctl(3, BLKRRPART, 0xbffff970) = -1 EINVAL (Invalid argument) ioctl(3, FDEJECT, 0xbffffac8) = -1 EINVAL (Invalid argument) ioctl(3, MGSL_IOCGPARAMS or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0xbffffa80) = -1 EINVAL (Invalid argument) open("/usr/share/locale/locale.alias", O_RDONLY) = 5 fstat64(5, {st_mode=S_IFREG|0644, st_size=2539, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x401aa000 read(5, "# Locale name alias data base.\n#"..., 4096) = 2539 read(5, "", 4096) = 0 close(5) = 0 munmap(0x401aa000, 4096) = 0 open("/usr/share/locale/cs_CZ/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/cs/LC_MESSAGES/libc.mo", O_RDONLY) = 5 fstat64(5, {st_mode=S_IFREG|0644, st_size=86276, ...}) = 0 mmap2(NULL, 86276, PROT_READ, MAP_PRIVATE, 5, 0) = 0x401aa000 close(5) = 0 open("/usr/share/locale/cs_CZ/LC_MESSAGES/eject.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/cs/LC_MESSAGES/eject.mo", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "eject: unable to eject, last err"..., 57) = 57 exit_group(1) = ? ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 7:18 ` Bc. Michal Semler @ 2004-09-16 7:36 ` Jens Axboe 2004-09-16 8:13 ` Bc. Michal Semler 2004-09-17 8:32 ` James Cloos 0 siblings, 2 replies; 23+ messages in thread From: Jens Axboe @ 2004-09-16 7:36 UTC (permalink / raw) To: Bc. Michal Semler; +Cc: linux-kernel (don't top post, and don't trim cc list!) On Thu, Sep 16 2004, Bc. Michal Semler wrote: > notas:/home/cijoml# mount /cdrom/ > notas:/home/cijoml# umount /cdrom/ > notas:/home/cijoml# strace -o eject /dev/hdc > eject: unable to eject, last error: Nep?ípustný argument > > As you can see, I dont't enter to directory... > > And output is included > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO (Input/output error) That's the important bit, the reason you get EINVAL passed back is because eject tries the floppy eject as well and decides to print the warning from that. It really should just stop of it sees -EIO, only continue if EINVAL/ENOTTY is passed back. Try this little c program and report back what it tells you. Compile with gcc -Wall -o eject eject.c and run without arguments. #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <string.h> #include <sys/ioctl.h> #include <linux/cdrom.h> int main(int argc, char *argv[]) { int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); struct cdrom_generic_command cgc; struct request_sense sense; memset(&cgc, 0, sizeof(cgc)); memset(&sense, 0, sizeof(sense)); cgc.cmd[0] = 0x1b; cgc.cmd[4] = 0x02; cgc.sense = &sense; cgc.data_direction = CGC_DATA_NONE; if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { printf("eject worked\n"); return 0; } printf("command failed - sense %x/%x/%x\n", sense.sense_key, sense.asc, sense.ascq); return 1; } -- Jens Axboe ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 7:36 ` Jens Axboe @ 2004-09-16 8:13 ` Bc. Michal Semler 2004-09-16 9:05 ` Jens Axboe 2004-09-17 8:32 ` James Cloos 1 sibling, 1 reply; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 8:13 UTC (permalink / raw) To: linux-kernel Dne čt 16. září 2004 09:36 jste napsal(a): > (don't top post, and don't trim cc list!) > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > notas:/home/cijoml# mount /cdrom/ > > notas:/home/cijoml# umount /cdrom/ > > notas:/home/cijoml# strace -o eject /dev/hdc > > eject: unable to eject, last error: Nep?ípustný argument > > > > As you can see, I dont't enter to directory... > > > > And output is included > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO (Input/output error) > > That's the important bit, the reason you get EINVAL passed back is > because eject tries the floppy eject as well and decides to print the > warning from that. It really should just stop of it sees -EIO, only > continue if EINVAL/ENOTTY is passed back. > > Try this little c program and report back what it tells you. Compile > with > > gcc -Wall -o eject eject.c > > and run without arguments. > > #include <stdio.h> > #include <stdlib.h> > #include <fcntl.h> > #include <string.h> > #include <sys/ioctl.h> > #include <linux/cdrom.h> > > int main(int argc, char *argv[]) > { > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > struct cdrom_generic_command cgc; > struct request_sense sense; > > memset(&cgc, 0, sizeof(cgc)); > memset(&sense, 0, sizeof(sense)); > > cgc.cmd[0] = 0x1b; > cgc.cmd[4] = 0x02; > cgc.sense = &sense; > cgc.data_direction = CGC_DATA_NONE; > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > printf("eject worked\n"); > return 0; > } > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, sense.asc, > sense.ascq); return 1; > } 2.4.27-mh1 notas:~# /home/cijoml/eject ATAPI device hdc: Error: Not ready -- (Sense key=0x02) (reserved error code) -- (asc=0x53, ascq=0x02) The failed "Start/Stop Unit" packet command was: "1b 00 00 00 02 00 00 00 00 00 00 00 " command failed - sense 2/53/2 2.6.9-rc2 notas:~# mount /cdrom/ notas:~# umount /cdrom/ notas:~# /home/cijoml/eject Here isn't opened command failed - sense 2/53/2 notas:~# eject /cdrom/ program eject is using a deprecated SCSI ioctl, please convert it to SG_IO program eject is using a deprecated SCSI ioctl, please convert it to SG_IO program eject is using a deprecated SCSI ioctl, please convert it to SG_IO Here is cd-rom opened eject: unable to eject, last error: Nepřípustný argument notas:~# /home/cijoml/eject Here is cd-rom opened eject worked ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 8:13 ` Bc. Michal Semler @ 2004-09-16 9:05 ` Jens Axboe 2004-09-16 9:13 ` Bc. Michal Semler 0 siblings, 1 reply; 23+ messages in thread From: Jens Axboe @ 2004-09-16 9:05 UTC (permalink / raw) To: Bc. Michal Semler; +Cc: linux-kernel On Thu, Sep 16 2004, Bc. Michal Semler wrote: > Dne ?t 16. zá?í 2004 09:36 jste napsal(a): > > (don't top post, and don't trim cc list!) don't trim the cc list!! > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > notas:/home/cijoml# mount /cdrom/ > > > notas:/home/cijoml# umount /cdrom/ > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > As you can see, I dont't enter to directory... > > > > > > And output is included > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO (Input/output error) > > > > That's the important bit, the reason you get EINVAL passed back is > > because eject tries the floppy eject as well and decides to print the > > warning from that. It really should just stop of it sees -EIO, only > > continue if EINVAL/ENOTTY is passed back. > > > > Try this little c program and report back what it tells you. Compile > > with > > > > gcc -Wall -o eject eject.c > > > > and run without arguments. > > > > #include <stdio.h> > > #include <stdlib.h> > > #include <fcntl.h> > > #include <string.h> > > #include <sys/ioctl.h> > > #include <linux/cdrom.h> > > > > int main(int argc, char *argv[]) > > { > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > struct cdrom_generic_command cgc; > > struct request_sense sense; > > > > memset(&cgc, 0, sizeof(cgc)); > > memset(&sense, 0, sizeof(sense)); > > > > cgc.cmd[0] = 0x1b; > > cgc.cmd[4] = 0x02; > > cgc.sense = &sense; > > cgc.data_direction = CGC_DATA_NONE; > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > printf("eject worked\n"); > > return 0; > > } > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, sense.asc, > > sense.ascq); return 1; > > } > > 2.4.27-mh1 > notas:~# /home/cijoml/eject > ATAPI device hdc: > Error: Not ready -- (Sense key=0x02) > (reserved error code) -- (asc=0x53, ascq=0x02) > The failed "Start/Stop Unit" packet command was: > "1b 00 00 00 02 00 00 00 00 00 00 00 " > command failed - sense 2/53/2 Your tray is still locked, are you sure it isn't mounted? -- Jens Axboe ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 9:05 ` Jens Axboe @ 2004-09-16 9:13 ` Bc. Michal Semler 2004-09-16 10:22 ` Jens Axboe 0 siblings, 1 reply; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 9:13 UTC (permalink / raw) To: linux-kernel > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > notas:/home/cijoml# mount /cdrom/ > > > > notas:/home/cijoml# umount /cdrom/ > > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > > > As you can see, I dont't enter to directory... > > > > > > > > And output is included > > > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO (Input/output error) > > > > > > That's the important bit, the reason you get EINVAL passed back is > > > because eject tries the floppy eject as well and decides to print the > > > warning from that. It really should just stop of it sees -EIO, only > > > continue if EINVAL/ENOTTY is passed back. > > > > > > Try this little c program and report back what it tells you. Compile > > > with > > > > > > gcc -Wall -o eject eject.c > > > > > > and run without arguments. > > > > > > #include <stdio.h> > > > #include <stdlib.h> > > > #include <fcntl.h> > > > #include <string.h> > > > #include <sys/ioctl.h> > > > #include <linux/cdrom.h> > > > > > > int main(int argc, char *argv[]) > > > { > > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > > struct cdrom_generic_command cgc; > > > struct request_sense sense; > > > > > > memset(&cgc, 0, sizeof(cgc)); > > > memset(&sense, 0, sizeof(sense)); > > > > > > cgc.cmd[0] = 0x1b; > > > cgc.cmd[4] = 0x02; > > > cgc.sense = &sense; > > > cgc.data_direction = CGC_DATA_NONE; > > > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > > printf("eject worked\n"); > > > return 0; > > > } > > > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, > > > sense.asc, sense.ascq); return 1; > > > } > > > > 2.4.27-mh1 > > notas:~# /home/cijoml/eject > > ATAPI device hdc: > > Error: Not ready -- (Sense key=0x02) > > (reserved error code) -- (asc=0x53, ascq=0x02) > > The failed "Start/Stop Unit" packet command was: > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > command failed - sense 2/53/2 > > Your tray is still locked, are you sure it isn't mounted? Yes I am. This is written into console and I am logged only into this console and I copied whole commands from login to eject... :( M. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 9:13 ` Bc. Michal Semler @ 2004-09-16 10:22 ` Jens Axboe 2004-09-16 11:44 ` Denis Vlasenko 2004-09-16 12:19 ` Bc. Michal Semler 0 siblings, 2 replies; 23+ messages in thread From: Jens Axboe @ 2004-09-16 10:22 UTC (permalink / raw) To: Bc. Michal Semler; +Cc: linux-kernel On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > notas:/home/cijoml# mount /cdrom/ > > > > > notas:/home/cijoml# umount /cdrom/ > > > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > > > > > As you can see, I dont't enter to directory... > > > > > > > > > > And output is included > > > > > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO (Input/output error) > > > > > > > > That's the important bit, the reason you get EINVAL passed back is > > > > because eject tries the floppy eject as well and decides to print the > > > > warning from that. It really should just stop of it sees -EIO, only > > > > continue if EINVAL/ENOTTY is passed back. > > > > > > > > Try this little c program and report back what it tells you. Compile > > > > with > > > > > > > > gcc -Wall -o eject eject.c > > > > > > > > and run without arguments. > > > > > > > > #include <stdio.h> > > > > #include <stdlib.h> > > > > #include <fcntl.h> > > > > #include <string.h> > > > > #include <sys/ioctl.h> > > > > #include <linux/cdrom.h> > > > > > > > > int main(int argc, char *argv[]) > > > > { > > > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > > > struct cdrom_generic_command cgc; > > > > struct request_sense sense; > > > > > > > > memset(&cgc, 0, sizeof(cgc)); > > > > memset(&sense, 0, sizeof(sense)); > > > > > > > > cgc.cmd[0] = 0x1b; > > > > cgc.cmd[4] = 0x02; > > > > cgc.sense = &sense; > > > > cgc.data_direction = CGC_DATA_NONE; > > > > > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > > > printf("eject worked\n"); > > > > return 0; > > > > } > > > > > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, > > > > sense.asc, sense.ascq); return 1; > > > > } > > > > > > 2.4.27-mh1 > > > notas:~# /home/cijoml/eject > > > ATAPI device hdc: > > > Error: Not ready -- (Sense key=0x02) > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > The failed "Start/Stop Unit" packet command was: > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > command failed - sense 2/53/2 > > > > Your tray is still locked, are you sure it isn't mounted? > > Yes I am. This is written into console and I am logged only into this > console and I copied whole commands from login to eject... :( For the third time, don't trim the cc list! group reply please. Something else must be keeping your drive locked. What else do you have running in the system? It's enough if one app is just holding the drive open, the drive wont get unlocked on umount then. -- Jens Axboe ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 10:22 ` Jens Axboe @ 2004-09-16 11:44 ` Denis Vlasenko 2004-09-16 12:20 ` Bc. Michal Semler 2004-09-16 12:19 ` Bc. Michal Semler 1 sibling, 1 reply; 23+ messages in thread From: Denis Vlasenko @ 2004-09-16 11:44 UTC (permalink / raw) To: Jens Axboe, Bc. Michal Semler; +Cc: linux-kernel > > > > 2.4.27-mh1 > > > > notas:~# /home/cijoml/eject > > > > ATAPI device hdc: > > > > Error: Not ready -- (Sense key=0x02) > > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > > The failed "Start/Stop Unit" packet command was: > > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > > command failed - sense 2/53/2 > > > > > > Your tray is still locked, are you sure it isn't mounted? > > > > Yes I am. This is written into console and I am logged only into this > > console and I copied whole commands from login to eject... :( > > For the third time, don't trim the cc list! group reply please. > > Something else must be keeping your drive locked. What else do you have > running in the system? It's enough if one app is just holding the drive > open, the drive wont get unlocked on umount then. Michal, you can use 'lsof -nP' to check for that -- vda ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 11:44 ` Denis Vlasenko @ 2004-09-16 12:20 ` Bc. Michal Semler 0 siblings, 0 replies; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 12:20 UTC (permalink / raw) To: Denis Vlasenko; +Cc: Jens Axboe, linux-kernel Dne čt 16. září 2004 13:44 Denis Vlasenko napsal(a): > > > > > 2.4.27-mh1 > > > > > notas:~# /home/cijoml/eject > > > > > ATAPI device hdc: > > > > > Error: Not ready -- (Sense key=0x02) > > > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > > > The failed "Start/Stop Unit" packet command was: > > > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > > > command failed - sense 2/53/2 > > > > > > > > Your tray is still locked, are you sure it isn't mounted? > > > > > > Yes I am. This is written into console and I am logged only into this > > > console and I copied whole commands from login to eject... :( > > > > For the third time, don't trim the cc list! group reply please. > > > > Something else must be keeping your drive locked. What else do you have > > running in the system? It's enough if one app is just holding the drive > > open, the drive wont get unlocked on umount then. > > Michal, you can use 'lsof -nP' to check for that > -- > vda Thanks fuser helped too... M. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 10:22 ` Jens Axboe 2004-09-16 11:44 ` Denis Vlasenko @ 2004-09-16 12:19 ` Bc. Michal Semler 2004-09-16 12:24 ` Jens Axboe 2004-09-16 12:52 ` Marc Ballarin 1 sibling, 2 replies; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 12:19 UTC (permalink / raw) To: Jens Axboe; +Cc: linux-kernel Dne čt 16. září 2004 12:22 Jens Axboe napsal(a): > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > notas:/home/cijoml# mount /cdrom/ > > > > > > notas:/home/cijoml# umount /cdrom/ > > > > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > > > > > > > As you can see, I dont't enter to directory... > > > > > > > > > > > > And output is included > > > > > > > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO (Input/output > > > > > > error) > > > > > > > > > > That's the important bit, the reason you get EINVAL passed back is > > > > > because eject tries the floppy eject as well and decides to print > > > > > the warning from that. It really should just stop of it sees -EIO, > > > > > only continue if EINVAL/ENOTTY is passed back. > > > > > > > > > > Try this little c program and report back what it tells you. > > > > > Compile with > > > > > > > > > > gcc -Wall -o eject eject.c > > > > > > > > > > and run without arguments. > > > > > > > > > > #include <stdio.h> > > > > > #include <stdlib.h> > > > > > #include <fcntl.h> > > > > > #include <string.h> > > > > > #include <sys/ioctl.h> > > > > > #include <linux/cdrom.h> > > > > > > > > > > int main(int argc, char *argv[]) > > > > > { > > > > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > > > > struct cdrom_generic_command cgc; > > > > > struct request_sense sense; > > > > > > > > > > memset(&cgc, 0, sizeof(cgc)); > > > > > memset(&sense, 0, sizeof(sense)); > > > > > > > > > > cgc.cmd[0] = 0x1b; > > > > > cgc.cmd[4] = 0x02; > > > > > cgc.sense = &sense; > > > > > cgc.data_direction = CGC_DATA_NONE; > > > > > > > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > > > > printf("eject worked\n"); > > > > > return 0; > > > > > } > > > > > > > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, > > > > > sense.asc, sense.ascq); return 1; > > > > > } > > > > > > > > 2.4.27-mh1 > > > > notas:~# /home/cijoml/eject > > > > ATAPI device hdc: > > > > Error: Not ready -- (Sense key=0x02) > > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > > The failed "Start/Stop Unit" packet command was: > > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > > command failed - sense 2/53/2 > > > > > > Your tray is still locked, are you sure it isn't mounted? > > > > Yes I am. This is written into console and I am logged only into this > > console and I copied whole commands from login to eject... :( > > For the third time, don't trim the cc list! group reply please. > > Something else must be keeping your drive locked. What else do you have > running in the system? It's enough if one app is just holding the drive > open, the drive wont get unlocked on umount then. only thing which access cdrom is cpudynd and it access harddrive too.... notas:~# fuser /dev/hdc /dev/hdc: 8102 notas:~# ps aux|grep 8102 root 8102 0.0 0.1 1536 456 ? SNs 13:49 0:00 /usr/sbin/cpudynd -i 1 -p 0.5 0.9 -l 7 -t 120 -h /dev/hda,/dev/hdc nothing more Michal ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 12:19 ` Bc. Michal Semler @ 2004-09-16 12:24 ` Jens Axboe 2004-09-16 12:29 ` Bc. Michal Semler ` (3 more replies) 2004-09-16 12:52 ` Marc Ballarin 1 sibling, 4 replies; 23+ messages in thread From: Jens Axboe @ 2004-09-16 12:24 UTC (permalink / raw) To: Bc. Michal Semler; +Cc: linux-kernel On Thu, Sep 16 2004, Bc. Michal Semler wrote: > Dne ?t 16. zá?í 2004 12:22 Jens Axboe napsal(a): > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > notas:/home/cijoml# mount /cdrom/ > > > > > > > notas:/home/cijoml# umount /cdrom/ > > > > > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > > > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > > > > > > > > > As you can see, I dont't enter to directory... > > > > > > > > > > > > > > And output is included > > > > > > > > > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO (Input/output > > > > > > > error) > > > > > > > > > > > > That's the important bit, the reason you get EINVAL passed back is > > > > > > because eject tries the floppy eject as well and decides to print > > > > > > the warning from that. It really should just stop of it sees -EIO, > > > > > > only continue if EINVAL/ENOTTY is passed back. > > > > > > > > > > > > Try this little c program and report back what it tells you. > > > > > > Compile with > > > > > > > > > > > > gcc -Wall -o eject eject.c > > > > > > > > > > > > and run without arguments. > > > > > > > > > > > > #include <stdio.h> > > > > > > #include <stdlib.h> > > > > > > #include <fcntl.h> > > > > > > #include <string.h> > > > > > > #include <sys/ioctl.h> > > > > > > #include <linux/cdrom.h> > > > > > > > > > > > > int main(int argc, char *argv[]) > > > > > > { > > > > > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > > > > > struct cdrom_generic_command cgc; > > > > > > struct request_sense sense; > > > > > > > > > > > > memset(&cgc, 0, sizeof(cgc)); > > > > > > memset(&sense, 0, sizeof(sense)); > > > > > > > > > > > > cgc.cmd[0] = 0x1b; > > > > > > cgc.cmd[4] = 0x02; > > > > > > cgc.sense = &sense; > > > > > > cgc.data_direction = CGC_DATA_NONE; > > > > > > > > > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > > > > > printf("eject worked\n"); > > > > > > return 0; > > > > > > } > > > > > > > > > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, > > > > > > sense.asc, sense.ascq); return 1; > > > > > > } > > > > > > > > > > 2.4.27-mh1 > > > > > notas:~# /home/cijoml/eject > > > > > ATAPI device hdc: > > > > > Error: Not ready -- (Sense key=0x02) > > > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > > > The failed "Start/Stop Unit" packet command was: > > > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > > > command failed - sense 2/53/2 > > > > > > > > Your tray is still locked, are you sure it isn't mounted? > > > > > > Yes I am. This is written into console and I am logged only into this > > > console and I copied whole commands from login to eject... :( > > > > For the third time, don't trim the cc list! group reply please. > > > > Something else must be keeping your drive locked. What else do you have > > running in the system? It's enough if one app is just holding the drive > > open, the drive wont get unlocked on umount then. > > only thing which access cdrom is cpudynd and it access harddrive too.... > > notas:~# fuser /dev/hdc > /dev/hdc: 8102 > notas:~# ps aux|grep 8102 > root 8102 0.0 0.1 1536 456 ? SNs 13:49 > 0:00 /usr/sbin/cpudynd -i 1 -p 0.5 0.9 -l 7 -t 120 -h /dev/hda,/dev/hdc well there you go, that is what is keeping the drive locked. cdrom cannot know which process locked it or not, all it knows is that the usage count is non-zero on umount, so it doesn't unlock the tray. -- Jens Axboe ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 12:24 ` Jens Axboe @ 2004-09-16 12:29 ` Bc. Michal Semler 2004-09-16 12:31 ` Bc. Michal Semler ` (2 subsequent siblings) 3 siblings, 0 replies; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 12:29 UTC (permalink / raw) To: Jens Axboe; +Cc: linux-kernel Dne čt 16. září 2004 14:24 Jens Axboe napsal(a): > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > Dne ?t 16. zá?í 2004 12:22 Jens Axboe napsal(a): > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > > notas:/home/cijoml# mount /cdrom/ > > > > > > > > notas:/home/cijoml# umount /cdrom/ > > > > > > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > > > > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > > > > > > > > > > > As you can see, I dont't enter to directory... > > > > > > > > > > > > > > > > And output is included > > > > > > > > > > > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO > > > > > > > > (Input/output error) > > > > > > > > > > > > > > That's the important bit, the reason you get EINVAL passed back > > > > > > > is because eject tries the floppy eject as well and decides to > > > > > > > print the warning from that. It really should just stop of it > > > > > > > sees -EIO, only continue if EINVAL/ENOTTY is passed back. > > > > > > > > > > > > > > Try this little c program and report back what it tells you. > > > > > > > Compile with > > > > > > > > > > > > > > gcc -Wall -o eject eject.c > > > > > > > > > > > > > > and run without arguments. > > > > > > > > > > > > > > #include <stdio.h> > > > > > > > #include <stdlib.h> > > > > > > > #include <fcntl.h> > > > > > > > #include <string.h> > > > > > > > #include <sys/ioctl.h> > > > > > > > #include <linux/cdrom.h> > > > > > > > > > > > > > > int main(int argc, char *argv[]) > > > > > > > { > > > > > > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > > > > > > struct cdrom_generic_command cgc; > > > > > > > struct request_sense sense; > > > > > > > > > > > > > > memset(&cgc, 0, sizeof(cgc)); > > > > > > > memset(&sense, 0, sizeof(sense)); > > > > > > > > > > > > > > cgc.cmd[0] = 0x1b; > > > > > > > cgc.cmd[4] = 0x02; > > > > > > > cgc.sense = &sense; > > > > > > > cgc.data_direction = CGC_DATA_NONE; > > > > > > > > > > > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > > > > > > printf("eject worked\n"); > > > > > > > return 0; > > > > > > > } > > > > > > > > > > > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, > > > > > > > sense.asc, sense.ascq); return 1; > > > > > > > } > > > > > > > > > > > > 2.4.27-mh1 > > > > > > notas:~# /home/cijoml/eject > > > > > > ATAPI device hdc: > > > > > > Error: Not ready -- (Sense key=0x02) > > > > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > > > > The failed "Start/Stop Unit" packet command was: > > > > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > > > > command failed - sense 2/53/2 > > > > > > > > > > Your tray is still locked, are you sure it isn't mounted? > > > > > > > > Yes I am. This is written into console and I am logged only into this > > > > console and I copied whole commands from login to eject... :( > > > > > > For the third time, don't trim the cc list! group reply please. > > > > > > Something else must be keeping your drive locked. What else do you have > > > running in the system? It's enough if one app is just holding the drive > > > open, the drive wont get unlocked on umount then. > > > > only thing which access cdrom is cpudynd and it access harddrive too.... > > > > notas:~# fuser /dev/hdc > > /dev/hdc: 8102 > > notas:~# ps aux|grep 8102 > > root 8102 0.0 0.1 1536 456 ? SNs 13:49 > > 0:00 /usr/sbin/cpudynd -i 1 -p 0.5 0.9 -l 7 -t 120 -h /dev/hda,/dev/hdc > > well there you go, that is what is keeping the drive locked. cdrom > cannot know which process locked it or not, all it knows is that the > usage count is non-zero on umount, so it doesn't unlock the tray. And what should I do? I need cpu scalling. And under 2.6 it works (cd-rom opening after umount) strange as I post before Michal ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 12:24 ` Jens Axboe 2004-09-16 12:29 ` Bc. Michal Semler @ 2004-09-16 12:31 ` Bc. Michal Semler 2004-09-16 12:36 ` Bc. Michal Semler 2004-09-16 21:48 ` Bc. Michal Semler 3 siblings, 0 replies; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 12:31 UTC (permalink / raw) To: Jens Axboe; +Cc: linux-kernel Dne čt 16. září 2004 14:24 Jens Axboe napsal(a): > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > Dne ?t 16. zá?í 2004 12:22 Jens Axboe napsal(a): > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > > notas:/home/cijoml# mount /cdrom/ > > > > > > > > notas:/home/cijoml# umount /cdrom/ > > > > > > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > > > > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > > > > > > > > > > > As you can see, I dont't enter to directory... > > > > > > > > > > > > > > > > And output is included > > > > > > > > > > > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO > > > > > > > > (Input/output error) > > > > > > > > > > > > > > That's the important bit, the reason you get EINVAL passed back > > > > > > > is because eject tries the floppy eject as well and decides to > > > > > > > print the warning from that. It really should just stop of it > > > > > > > sees -EIO, only continue if EINVAL/ENOTTY is passed back. > > > > > > > > > > > > > > Try this little c program and report back what it tells you. > > > > > > > Compile with > > > > > > > > > > > > > > gcc -Wall -o eject eject.c > > > > > > > > > > > > > > and run without arguments. > > > > > > > > > > > > > > #include <stdio.h> > > > > > > > #include <stdlib.h> > > > > > > > #include <fcntl.h> > > > > > > > #include <string.h> > > > > > > > #include <sys/ioctl.h> > > > > > > > #include <linux/cdrom.h> > > > > > > > > > > > > > > int main(int argc, char *argv[]) > > > > > > > { > > > > > > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > > > > > > struct cdrom_generic_command cgc; > > > > > > > struct request_sense sense; > > > > > > > > > > > > > > memset(&cgc, 0, sizeof(cgc)); > > > > > > > memset(&sense, 0, sizeof(sense)); > > > > > > > > > > > > > > cgc.cmd[0] = 0x1b; > > > > > > > cgc.cmd[4] = 0x02; > > > > > > > cgc.sense = &sense; > > > > > > > cgc.data_direction = CGC_DATA_NONE; > > > > > > > > > > > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > > > > > > printf("eject worked\n"); > > > > > > > return 0; > > > > > > > } > > > > > > > > > > > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, > > > > > > > sense.asc, sense.ascq); return 1; > > > > > > > } > > > > > > > > > > > > 2.4.27-mh1 > > > > > > notas:~# /home/cijoml/eject > > > > > > ATAPI device hdc: > > > > > > Error: Not ready -- (Sense key=0x02) > > > > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > > > > The failed "Start/Stop Unit" packet command was: > > > > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > > > > command failed - sense 2/53/2 > > > > > > > > > > Your tray is still locked, are you sure it isn't mounted? > > > > > > > > Yes I am. This is written into console and I am logged only into this > > > > console and I copied whole commands from login to eject... :( > > > > > > For the third time, don't trim the cc list! group reply please. > > > > > > Something else must be keeping your drive locked. What else do you have > > > running in the system? It's enough if one app is just holding the drive > > > open, the drive wont get unlocked on umount then. > > > > only thing which access cdrom is cpudynd and it access harddrive too.... > > > > notas:~# fuser /dev/hdc > > /dev/hdc: 8102 > > notas:~# ps aux|grep 8102 > > root 8102 0.0 0.1 1536 456 ? SNs 13:49 > > 0:00 /usr/sbin/cpudynd -i 1 -p 0.5 0.9 -l 7 -t 120 -h /dev/hda,/dev/hdc > > well there you go, that is what is keeping the drive locked. cdrom > cannot know which process locked it or not, all it knows is that the > usage count is non-zero on umount, so it doesn't unlock the tray. This is written on cpudyn website: Disk Standby Tired of playing with hdparm and /etc/apm to save battery in your laptop or to make your desktop more quiet? Don't waste more time, you've found the solution :-) Since version 0.2.0, the program is also able to put the computer disks in standby mode, if a given period has passed without any I/O operation. It works very well even with Journaled File Systems such as Ext3, XFS and ReiserFS. Options "-t timeout" and "-h dev0[,dev1]..." control this behaviour. It is __not__ activated by default, -t _or_ -h activated. Please check the usage and edit /etc/init.d/cpudyn if you need to activate it at startup time. This feature works also with Linux 2.4.X and 2.5.X since version 0.30 Example: cpudynd -i 1 -t 60 -h /dev/hda,/dev/hdc ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 12:24 ` Jens Axboe 2004-09-16 12:29 ` Bc. Michal Semler 2004-09-16 12:31 ` Bc. Michal Semler @ 2004-09-16 12:36 ` Bc. Michal Semler 2004-09-16 21:48 ` Bc. Michal Semler 3 siblings, 0 replies; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 12:36 UTC (permalink / raw) To: Jens Axboe; +Cc: linux-kernel Dne čt 16. září 2004 14:24 Jens Axboe napsal(a): > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > Dne ?t 16. zá?í 2004 12:22 Jens Axboe napsal(a): > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > > notas:/home/cijoml# mount /cdrom/ > > > > > > > > notas:/home/cijoml# umount /cdrom/ > > > > > > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > > > > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > > > > > > > > > > > As you can see, I dont't enter to directory... > > > > > > > > > > > > > > > > And output is included > > > > > > > > > > > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO > > > > > > > > (Input/output error) > > > > > > > > > > > > > > That's the important bit, the reason you get EINVAL passed back > > > > > > > is because eject tries the floppy eject as well and decides to > > > > > > > print the warning from that. It really should just stop of it > > > > > > > sees -EIO, only continue if EINVAL/ENOTTY is passed back. > > > > > > > > > > > > > > Try this little c program and report back what it tells you. > > > > > > > Compile with > > > > > > > > > > > > > > gcc -Wall -o eject eject.c > > > > > > > > > > > > > > and run without arguments. > > > > > > > > > > > > > > #include <stdio.h> > > > > > > > #include <stdlib.h> > > > > > > > #include <fcntl.h> > > > > > > > #include <string.h> > > > > > > > #include <sys/ioctl.h> > > > > > > > #include <linux/cdrom.h> > > > > > > > > > > > > > > int main(int argc, char *argv[]) > > > > > > > { > > > > > > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > > > > > > struct cdrom_generic_command cgc; > > > > > > > struct request_sense sense; > > > > > > > > > > > > > > memset(&cgc, 0, sizeof(cgc)); > > > > > > > memset(&sense, 0, sizeof(sense)); > > > > > > > > > > > > > > cgc.cmd[0] = 0x1b; > > > > > > > cgc.cmd[4] = 0x02; > > > > > > > cgc.sense = &sense; > > > > > > > cgc.data_direction = CGC_DATA_NONE; > > > > > > > > > > > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > > > > > > printf("eject worked\n"); > > > > > > > return 0; > > > > > > > } > > > > > > > > > > > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, > > > > > > > sense.asc, sense.ascq); return 1; > > > > > > > } > > > > > > > > > > > > 2.4.27-mh1 > > > > > > notas:~# /home/cijoml/eject > > > > > > ATAPI device hdc: > > > > > > Error: Not ready -- (Sense key=0x02) > > > > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > > > > The failed "Start/Stop Unit" packet command was: > > > > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > > > > command failed - sense 2/53/2 > > > > > > > > > > Your tray is still locked, are you sure it isn't mounted? > > > > > > > > Yes I am. This is written into console and I am logged only into this > > > > console and I copied whole commands from login to eject... :( > > > > > > For the third time, don't trim the cc list! group reply please. > > > > > > Something else must be keeping your drive locked. What else do you have > > > running in the system? It's enough if one app is just holding the drive > > > open, the drive wont get unlocked on umount then. > > > > only thing which access cdrom is cpudynd and it access harddrive too.... > > > > notas:~# fuser /dev/hdc > > /dev/hdc: 8102 > > notas:~# ps aux|grep 8102 > > root 8102 0.0 0.1 1536 456 ? SNs 13:49 > > 0:00 /usr/sbin/cpudynd -i 1 -p 0.5 0.9 -l 7 -t 120 -h /dev/hda,/dev/hdc > > well there you go, that is what is keeping the drive locked. cdrom > cannot know which process locked it or not, all it knows is that the > usage count is non-zero on umount, so it doesn't unlock the tray. And very important info is, that same harddisk image I use on about 25 laptops in company and those works fine with it. Only this one doesn't. And I can't send it to Acer, coz under WinXP cdrom works fine :( Michal ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 12:24 ` Jens Axboe ` (2 preceding siblings ...) 2004-09-16 12:36 ` Bc. Michal Semler @ 2004-09-16 21:48 ` Bc. Michal Semler 2004-09-16 22:17 ` Tim Fairchild 3 siblings, 1 reply; 23+ messages in thread From: Bc. Michal Semler @ 2004-09-16 21:48 UTC (permalink / raw) To: Jens Axboe; +Cc: linux-kernel Dne čt 16. září 2004 14:24 Jens Axboe napsal(a): > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > Dne ?t 16. zá?í 2004 12:22 Jens Axboe napsal(a): > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > On Thu, Sep 16 2004, Bc. Michal Semler wrote: > > > > > > > > notas:/home/cijoml# mount /cdrom/ > > > > > > > > notas:/home/cijoml# umount /cdrom/ > > > > > > > > notas:/home/cijoml# strace -o eject /dev/hdc > > > > > > > > eject: unable to eject, last error: Nep?ípustný argument > > > > > > > > > > > > > > > > As you can see, I dont't enter to directory... > > > > > > > > > > > > > > > > And output is included > > > > > > > > > > > > > > > > ioctl(3, CDROMEJECT, 0xbffffac8) = -1 EIO > > > > > > > > (Input/output error) > > > > > > > > > > > > > > That's the important bit, the reason you get EINVAL passed back > > > > > > > is because eject tries the floppy eject as well and decides to > > > > > > > print the warning from that. It really should just stop of it > > > > > > > sees -EIO, only continue if EINVAL/ENOTTY is passed back. > > > > > > > > > > > > > > Try this little c program and report back what it tells you. > > > > > > > Compile with > > > > > > > > > > > > > > gcc -Wall -o eject eject.c > > > > > > > > > > > > > > and run without arguments. > > > > > > > > > > > > > > #include <stdio.h> > > > > > > > #include <stdlib.h> > > > > > > > #include <fcntl.h> > > > > > > > #include <string.h> > > > > > > > #include <sys/ioctl.h> > > > > > > > #include <linux/cdrom.h> > > > > > > > > > > > > > > int main(int argc, char *argv[]) > > > > > > > { > > > > > > > int fd = open("/dev/hdc", O_RDONLY | O_NONBLOCK); > > > > > > > struct cdrom_generic_command cgc; > > > > > > > struct request_sense sense; > > > > > > > > > > > > > > memset(&cgc, 0, sizeof(cgc)); > > > > > > > memset(&sense, 0, sizeof(sense)); > > > > > > > > > > > > > > cgc.cmd[0] = 0x1b; > > > > > > > cgc.cmd[4] = 0x02; > > > > > > > cgc.sense = &sense; > > > > > > > cgc.data_direction = CGC_DATA_NONE; > > > > > > > > > > > > > > if (ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0) { > > > > > > > printf("eject worked\n"); > > > > > > > return 0; > > > > > > > } > > > > > > > > > > > > > > printf("command failed - sense %x/%x/%x\n", sense.sense_key, > > > > > > > sense.asc, sense.ascq); return 1; > > > > > > > } > > > > > > > > > > > > 2.4.27-mh1 > > > > > > notas:~# /home/cijoml/eject > > > > > > ATAPI device hdc: > > > > > > Error: Not ready -- (Sense key=0x02) > > > > > > (reserved error code) -- (asc=0x53, ascq=0x02) > > > > > > The failed "Start/Stop Unit" packet command was: > > > > > > "1b 00 00 00 02 00 00 00 00 00 00 00 " > > > > > > command failed - sense 2/53/2 > > > > > > > > > > Your tray is still locked, are you sure it isn't mounted? > > > > > > > > Yes I am. This is written into console and I am logged only into this > > > > console and I copied whole commands from login to eject... :( > > > > > > For the third time, don't trim the cc list! group reply please. > > > > > > Something else must be keeping your drive locked. What else do you have > > > running in the system? It's enough if one app is just holding the drive > > > open, the drive wont get unlocked on umount then. > > > > only thing which access cdrom is cpudynd and it access harddrive too.... > > > > notas:~# fuser /dev/hdc > > /dev/hdc: 8102 > > notas:~# ps aux|grep 8102 > > root 8102 0.0 0.1 1536 456 ? SNs 13:49 > > 0:00 /usr/sbin/cpudynd -i 1 -p 0.5 0.9 -l 7 -t 120 -h /dev/hda,/dev/hdc > > well there you go, that is what is keeping the drive locked. cdrom > cannot know which process locked it or not, all it knows is that the > usage count is non-zero on umount, so it doesn't unlock the tray. Well I killed cpudyn and everything behaves the same... :( # fuser /dev/hdc # Michal ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 21:48 ` Bc. Michal Semler @ 2004-09-16 22:17 ` Tim Fairchild 0 siblings, 0 replies; 23+ messages in thread From: Tim Fairchild @ 2004-09-16 22:17 UTC (permalink / raw) To: cijoml; +Cc: Jens Axboe, linux-kernel On Friday 17 Sep 2004 07:48, Bc. Michal Semler wrote: > Dne čt 16. září 2004 14:24 Jens Axboe napsal(a): > > well there you go, that is what is keeping the drive locked. cdrom > > cannot know which process locked it or not, all it knows is that the > > usage count is non-zero on umount, so it doesn't unlock the tray. > > Well I killed cpudyn and everything behaves the same... :( Sorry to butt in, but I'm curious to know if this is the mitsumi drive on the Acer TravelMate 242X you are referring to? Thanks. tim ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 12:19 ` Bc. Michal Semler 2004-09-16 12:24 ` Jens Axboe @ 2004-09-16 12:52 ` Marc Ballarin 1 sibling, 0 replies; 23+ messages in thread From: Marc Ballarin @ 2004-09-16 12:52 UTC (permalink / raw) To: cijoml; +Cc: axboe, linux-kernel On Thu, 16 Sep 2004 14:19:38 +0200 "Bc. Michal Semler" <cijoml@volny.cz> wrote: > only thing which access cdrom is cpudynd and it access harddrive too.... > > notas:~# fuser /dev/hdc > /dev/hdc: 8102 > notas:~# ps aux|grep 8102 > root 8102 0.0 0.1 1536 456 ? SNs 13:49 > 0:00 /usr/sbin/cpudynd -i 1 -p 0.5 0.9 -l 7 -t 120 -h /dev/hda,/dev/hdc > > nothing more Well, one user is enough to block. Just remove /dev/hdc from cpudynd's options. There should be little or no gain by adding your CD-Rom, anyway. Regards ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-16 7:36 ` Jens Axboe 2004-09-16 8:13 ` Bc. Michal Semler @ 2004-09-17 8:32 ` James Cloos 2004-09-17 8:43 ` Jens Axboe 1 sibling, 1 reply; 23+ messages in thread From: James Cloos @ 2004-09-17 8:32 UTC (permalink / raw) To: Jens Axboe; +Cc: Bc. Michal Semler, linux-kernel I gave this program a try as well. Eject has been failing on my laptop for quite a few kernel revisions. Even using the keyboard's Fn+F10 fails. Failures come with an extended beep -- 2 seconds or so -- and a system pause (smbios I presume). Your eject (edited only to use /dev/hdb) reports: :; ~/src/jens-eject command failed - sense 2/53/0 -JimC ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-17 8:32 ` James Cloos @ 2004-09-17 8:43 ` Jens Axboe 2004-09-17 9:00 ` Meelis Roos 2004-09-17 20:27 ` James Cloos 0 siblings, 2 replies; 23+ messages in thread From: Jens Axboe @ 2004-09-17 8:43 UTC (permalink / raw) To: James Cloos; +Cc: Bc. Michal Semler, linux-kernel On Fri, Sep 17 2004, James Cloos wrote: > I gave this program a try as well. > > Eject has been failing on my laptop for quite a few kernel > revisions. Even using the keyboard's Fn+F10 fails. > > Failures come with an extended beep -- 2 seconds or so -- > and a system pause (smbios I presume). > > Your eject (edited only to use /dev/hdb) reports: > > :; ~/src/jens-eject > command failed - sense 2/53/0 Exactly the same issue, read the thread - your tray is locked, because someone else has the drive open. -- Jens Axboe ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-17 8:43 ` Jens Axboe @ 2004-09-17 9:00 ` Meelis Roos 2004-09-17 20:27 ` James Cloos 1 sibling, 0 replies; 23+ messages in thread From: Meelis Roos @ 2004-09-17 9:00 UTC (permalink / raw) To: axboe, linux-kernel JA> Exactly the same issue, read the thread - your tray is locked, because JA> someone else has the drive open. In my case it's kscd thats' keeping the device open. kscd is in D state, wchan is ide_do_drive_cmd. Perhaps it's in D state because I once forced the CD open using cdrecod -eject. -- Meelis Roos ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: CD-ROM can't be ejected 2004-09-17 8:43 ` Jens Axboe 2004-09-17 9:00 ` Meelis Roos @ 2004-09-17 20:27 ` James Cloos 1 sibling, 0 replies; 23+ messages in thread From: James Cloos @ 2004-09-17 20:27 UTC (permalink / raw) To: linux-kernel; +Cc: Jens Axboe, Bc. Michal Semler >>>>> "Jens" == Jens Axboe <axboe@suse.de> writes: Jens> Exactly the same issue, read the thread - your tray is locked, Jens> because someone else has the drive open. Odd, since there is no disc in it. lsof shows nothing; manually looking thru /proc shows nothing. Is there any other way to find what does? Is there anything internal in the kernel that might have it open w/o reporting that fact to userspace? -JimC ^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2004-09-17 20:27 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15 22:25 CD-ROM can't be ejected Bc. Michal Semler
[not found] ` <c93051e804091517017ff9f29f@mail.gmail.com>
2004-09-16 6:55 ` Bc. Michal Semler
2004-09-16 7:09 ` Jens Axboe
2004-09-16 7:18 ` Bc. Michal Semler
2004-09-16 7:36 ` Jens Axboe
2004-09-16 8:13 ` Bc. Michal Semler
2004-09-16 9:05 ` Jens Axboe
2004-09-16 9:13 ` Bc. Michal Semler
2004-09-16 10:22 ` Jens Axboe
2004-09-16 11:44 ` Denis Vlasenko
2004-09-16 12:20 ` Bc. Michal Semler
2004-09-16 12:19 ` Bc. Michal Semler
2004-09-16 12:24 ` Jens Axboe
2004-09-16 12:29 ` Bc. Michal Semler
2004-09-16 12:31 ` Bc. Michal Semler
2004-09-16 12:36 ` Bc. Michal Semler
2004-09-16 21:48 ` Bc. Michal Semler
2004-09-16 22:17 ` Tim Fairchild
2004-09-16 12:52 ` Marc Ballarin
2004-09-17 8:32 ` James Cloos
2004-09-17 8:43 ` Jens Axboe
2004-09-17 9:00 ` Meelis Roos
2004-09-17 20:27 ` James Cloos
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox