Wednesday, November 14, 2007

Mounting and Sharing CD/DVD ISO Images with Ubuntu and Samba

This is a WIP, draft quality now:

If you plan on having more then 8 Loop devices (loop0 - loop7) you need to set an option in "/etc/modprobe.d/options" called "option loop max_loop=255", or whatever number you need, then reboot the system.

  1. Copy the CD/DVD Images to a folder on your Ubuntu system hard disk
  2. Mount the image with the following command:
    • Syntax: mount -t iso9660 -o loop /path/to/image.iso /path/to/mountpoint
    • Real example: mount -t iso9660 -o loop /opt/CDImages/Ubuntu-710.iso /mnt
  3. Edit the samba config file:
    • vi /etc/samba/smb.conf
  4. Add the following lines:
[Sharename]
comment = Some descriptive comment or serial key
path = /mnt
valid users = testuser
available = yes
browseable = yes
public = yes
writeable = no

  1. Now add a user that we will use for authentication
    • useradd testuser
    • usermod -s /bin/false testuser
  2. Make sure you do NOT set a UNIX password for this account, we don't want people logging into the Linux box
  3. DO set a password for samba
    • smbpasswd -a testuser
  4. restart the samba server
    • /etc/init.d/samba restart
Now in your windows machine open windows explorer or my computer. In the address bar type \\servername OR \\svr.ip.add.res

NOTE this has change fro 10.04.1:

you need to modify your "/boot/grub/grub.cfg" and modify your menu entries to look like the follwing, note the "max_loop=128" part of the kernel line:

menuentry 'Ubuntu, with Linux 2.6.32-30-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 30c0ecfe-1708-4bec-b545-127d23466906
linux /vmlinuz-2.6.32-30-generic-pae root=/dev/mapper/Hostname-root ro quiet max_loop=128
initrd /initrd.img-2.6.32-30-generic-pae
}

No comments: