Networking Forums

Networking Forums > Computer Networking > Linux Networking > Samba clients can't see partitions mounted via loop device from image files

Reply
Thread Tools Display Modes

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

 
 
Dave Burton
Guest
Posts: n/a

 
      08-28-2005, 04:30 AM
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 else 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 symptoms 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 accessible.
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


 
Reply With Quote
 
 
 
 
Dave Burton
Guest
Posts: n/a

 
      09-02-2005, 05:32 PM
The problem had nothing to do with the use of the loop
device. The "mount" commands were the problem. They
needed the "-o umask=0" option, so that Samba's "nobody"
user could access the mounted partitions:

mount -t ntfs -o umask=0 /dev/loop1 /mnt/img1
mount -t vfat -o umask=0 /dev/loop2 /mnt/img2

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


"Dave Burton" <(E-Mail Removed)> wrote in message
newsradneWCAdVzoIzeRVn-(E-Mail Removed)...
> Is there something special about filesystems mounted via
> the loop device, which prevents Samba from sharing them?

....
> 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

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

....
> 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 accessible.
> 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.

....


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache not serving from CIFS-mounted share, works if it's mounted asSMBFS Rick Onanian Linux Networking 3 03-27-2008 07:45 PM
Samba mounted subdirectories: ownerships damaged rtn@zhwin.ch Linux Networking 0 06-17-2005 02:27 PM
NFS and sub-mounted partitions John Stolz Linux Networking 2 06-06-2005 10:34 AM
linux clients for W2K domains. (key words samba kerberos ldap winbind clients) nerak99 Linux Networking 0 01-17-2004 02:21 PM
help! - NTFS network drive mounted smbfs has invisible files? Jeff Linux Networking 0 08-06-2003 10:07 PM



1 2 3 4 5 6 7 8 9 10 11