[Samba] Samba clients can't see partitions mounted via loop device from image files

David Burton dave146 at burtonsys.com
Sat Aug 27 11:05:42 GMT 2005


Is there something special about filesystems mounted via
the loop device, which prevents Samba from sharing them?

I have a small LAN with several PCs on it.  It has a
few Windows machines, and a Linux machine running
Mandrake 10 (kernel 2.6.3), which shares out its root
("/") read-only as "c".

(Temporarily, for testing, it is shared with full write
permissions, which I know is terrible.)

On the Mandrake (er, Mandriva) Linux box, I have image
files from a few small hard disk drives.  While logged
on as root, I've mounted partitions on two of those
image files, via the loop device:

  # first partition in drive1.ima is an NTFS partition:
  losetup -r -o 32256 /dev/loop1 drive1.ima
  mount -t ntfs /dev/loop1 /mnt/img1
  # first partition in drive2.ima is a FAT32 partition:
  losetup -o 32256 /dev/loop2 drive2.ima
  mount -t vfat /dev/loop2 /mnt/img2

The drive*.ima files and /mnt/img* mount points are all
owned by root and are wide-open ("chmod 777").

The loop device mounts work fine: From the Linux box, I
can view the files in both /mnt/img1/* and /mnt/img2/*
with no problems, and I can create or modify files in
/mnt/img2/*

Samba is also working: From a Win2K or WinNT 4.0 client
PC, I can see everything on the Linux box, and I can
read (and temporarily write) files in any of the other
partitions which are mounted on the Linux box.

But the Windows client machines cannot see any files
on either of the two loop-device-mounted partitions.
Why??

Note that the syptoms on the two partitions are different.

Attempting to browse \\Linuxbox\c\mnt\img1\ (the NTFS
partition) from either Windows PC yields:

   Exploring - \\Linuxbox\c\mnt\img1
   --------------------------------------------
   X   \\Linuxbox\c\mnt\img1 is not accessable.
       Access is denied.
            [Retry]  [Cancel]

Attempting the browse \\Linuxbox\c\mnt\img2\ (the FAT32
partition) from either Windows PC gives no error, but
doesn't show any files, either.  It is almost as if there
was nothing mounted on the mount point folder.  But I can
tell that the Linux box does know that /mnt/img1 is being
accessed, because when a Windows PC is browsing the contents
of \\Linuxbox\c\mnt\img2\ in Windows Explorer (and seeing
nothing but an empty folder), the Linux box nevertheless
cannot umount it, because the umount command yields an error:

   umount: /mnt/img2: device is busy

Does anyone know what is going wrong, and how to fix it,
so that the Windows machines can see the loop-device-mounted
partitions?

Thanks!

-Dave
dave146 at burtonsys dot com, but please no spam


More information about the samba mailing list