[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

apt and network smb-cdrom problems



Hello, world.

I have faced with the following problem.

There is a PC without CDROM drive, but it is connected to another PC which has
CDROM drive. I want to use second machine's CDROM as an apt source for the
first machine. The second machine has Windows installed, so I've choosen to
mount its CDROM via SMB. Debian Woody 3.0r0 without security updates is
installed on the first machine. I use default (vanilla?) kernel 2.2.20 from the
distribution, samba client part also from distribution. Samba server part is
not installed.

I've placed the needed string (like "//machine2/cdrom /cdrom smbfs ro,guest,... 0 0")
int /etc/fstab. After that mount/umount work fine, I can mount and read
disk and files on it. Apt-cdrom added all 7 binary CDs flawlessly, mounting and
unmounting it as necessary.

After that I try to install some package, for example icewm, giving command
    apt-get install icewm
I am prompted with "Insert disk Binary-2". I have inserted disk Binary-2 into
the machine2's CDROM, so I just press [Enter]. But I am prompting again
about inserting disk Binary-2, and such forever. Apt does not accept disk.

I've read mans for apt and its config, docs in /usr/share/doc/apt, Apt-HOWTO,
but without success. I tried to mount CD manually, turning off mounting in apt.conf,
tried to provide mount command as man reccomends, tried even to write mount
point to apt.conf - no success. BTW, support for SMB-CDROMs implicitly stated
in "man apt.conf":
"It  is  possible  to provide alternate mount and unmount commands if your
mount point can-not  be  listed  in the fstab (such as an SMB mount
and old mount packages)."

I tried to discover apt-get under strace and this is what I have found out.
/usr/bin/apt-get invokes /usr/lib/apt/methods and communicates with it
via stdin/stdout. I've noticed that /usr/lib/apt/methods/cdrom responds
with "403 Media Failure" message. I don't know why it said that, because
my CDs are fine and fine-readable. I also noticed that /usr/lib/apt/methods/cdrom
calls stat(2) for "/cdrom/" and "/cdrom/../". I've watched apt c++ sources
and have found 2 stats in IsMounted() function. It should work fine, because
st_dev in struct stat should differ even in case of smbfs-mounted filesystem.

I had not experienced such problems in Potato with Potato's apt. Everything
worked fine.

If I add this CD as a local file:// source to sources.list - everything works fine,
packages are fethced and installed.

What can I do? Is it an apt bug?
Can someone try to reproduce my situation (and thus a problem) ?

Regards,
Alexei.




Reply to: