Frank Murphy wrote:
> Finally installed Fedora Core 1.
> Using server setup.
>> Q1 How do I find a 2nd hd I formatted as Fat32,
'more dmesg' to show what drives were detected during bootup. It will
probably be visible as /dev/hdb or /dev/hdc. This is the physical drive.
'fdisk /dev/hdb' (or /dev/hdc, as relevant), to show a list of the
partitions and their sizes on the selected physical disk. This will
indicate which partition on the physical disk is formatted with the
FAT32 partition that you want. If there's only a single partition, then
it'll be '/dev/hdb1'
To mount the partition so that applications can access the data :
mount -t vfat /dev/hdb1 /mnt/dosdisk
and to arrange it so that the disk is always remounted on boot, and
safely unmounted on reboot, add the following line to /etc/fstab :
/dev/hdb1 /mnt/doskdisk vfat defaults 0 0
which will tell the kernel to always mount that partition under that
directory, as a VFAT (FAT 32) partition, using the default options.
The 'mount point', /mnt/dosdisk, is a local empty directory onto which
the contents of the disk are mounted. At that point the entire directory
tree of the newly mounted drive will appear under the /mnt/dosdisk
directory. Obviously, this is an example : you can call this whatever
you want and have it anywhere on your directory tree.
At this stage the disk is visible to Linux, mounted as a local disk, and
visible to any *local* application on your server.
> Q2. then how do I share it with samba.
Stage 2 : now that you can see the data locally, samba can see it also,
which means that you only need to configure samba to export it. This
requires you to tell samba where the data is, what you want it exported
as, and what permissions you want to assign to it.
Add a section such as
comment = Public
path = /mnt/dosdisk
force user = guest
public = yes
writable = yes
printable = no
to your /etc/samba/smb.conf file, which will tell samba that you want to
export that directory, calling it 'Public' to everyone else. The other
sections indicate that you want to force all user accesses to it to use
the local user 'public', and that it can be written to.
For a more detailed explanation of this, 'man smb.conf' will explain how
to handle advanced configurations.
> Q3. How do I get samba to autostart and mount this drive
In order to get anything to autostart (i.e. on boot), it needs to be in
the startup directory. If this is a pure server, it will probably be on
runlevel 3, which is the non-graphical mode. This means that all of the
startup scripts in '/etc/rc3.d' will be executed. If you have a server
with a graphical startup, then use the runlevel 5 directory : /etc/rc5.d
Either way, just make sure that there is a link to the samba startup
file in the directory, which will appear as :
S70smb -> ../init.d/smb
or equivalent. This is not a script in it's own right, but a softlink to
the real startup script which is in /etc/rc.d/init.d. If there is no
link present, and you want to add one, then cd to the directory and :
ln -s ../init.d/smb S70smb
which will create the link for you.
In future, every time the machine starts up this script will be run
automatically, starting the samba server and exporting whatever it's
configured to handle.
> Q4. What config is needed in the firewall , to allow access from the
> local PC's
Ports 137 and 139 to and from any machine involved in exporting or
accessing data. These are the service ports that Windows uses for
running it's SMB system on, which Samba copies.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!