-   Linux - Newbie (
-   -   Hdd sharing (

zc923 08-11-2003 04:17 PM

Hdd sharing
This is sort of a three in one question. Let me start with an into to my problem. My linux box is a dual boot system, win 98 SE, and red hat 9.0 personal. I have a huge drive (160 gig) on my linux box. I made fat16 (VFAT) partitions on the drive so that windows and linux could communicate with the drive. Through windows 98, I have shared the partitions. On my network, I have 4 windows PCs running. Now my question are: (1) how do I get linux to recognize my network?, (2) how do I share the partition through linux?, (3) how do I access the partitions through linux.

Thanks for the help in advanced

codecruncher 08-11-2003 04:24 PM

You have much to learn my young apprentice...

OK, first you need to mount your fat partitions into linux. For this check out the mount command. (Hint: mount /dev/hdXY /mnt/fat1 - where X is your disk and Y your partition).

Second - once mounted succesfully - you need to dance .samba. With which you will share your Disks in your network, and also - almost by magic - your linux machine will appear in your windows enviroment.


Skyline 08-11-2003 04:54 PM

  1. 2 ) - - In terms of Linux - You "share" partitions between OS's by mounting the filesystem of the shared partition into your main Linux directory tree.

    3 ) - - Again - you can "access" a partition when it has been mounted succesfully.

In general - to mount a Windows partition in Linux you:

Create a mount point - as Root user - mkdir /mnt/windows

Then put an entry in /etc/fstab - as Root user - Kedit /etc/fstab (or whatever editor you want to use)

/dev/hda1 /mnt/windows vfat auto,umask=000 0 0

This line would mount a FAT32 filesystem from /dev/hda1 to /mnt/windows automatically on boot up.

Electro 08-11-2003 06:06 PM

FAT16 cannot create more than 2 gigabytes and it waste space too (32 kilobytes per cluster). LINUX can handle FAT32 and FAT32 can create up to a two terabytes. Why you think LINUX can only handle FAT16?


Second - once mounted succesfully - you need to dance .samba. With which you will share your Disks in your network, and also - almost by magic - your linux machine will appear in your windows enviroment.
Not true if you didn't add any samba users or you set sercurity to users in the smb.conf file.

Some LINUX documents written for Newbies

Hardcore LINUX documents

zc923 08-11-2003 06:23 PM

Can someone give a detailed discription on how to mount the drive?


michaelk 08-11-2003 06:51 PM

You can find lots of help on beginner questions if you do a little searching yourself.

Check out this thread.

Redhat docs

Skyline 08-11-2003 07:47 PM


Can someone give a detailed discription on how to mount the drive?
In terms of mounting a filesystem, I've already gave you 90% of the answer in post 3 - its all there - Its up to you if you want to adapt it to suit your FAT16 situation - or as Electro alluded to - go with FAT32 for Win98se - I'd go with FAT32.

zc923 08-11-2003 08:35 PM

ok, mkdir /mnt/windows, I do this, makes directory in /mnt.
When I do /etc/fstab, i get bash: etc/fstab Permission denied. Im logged in as root.
When I do /dev/hda1 /mnt/windows vfat auto,umask=000 0 0, i get the same permission denied error.

The reason Im going with fat16 is that there is a posibility for a unix server being added to the network, so I want to make sure everything runs smoothly.

michaelk 08-11-2003 09:16 PM

What do you mean by do? You need to modify the /etc/fstab file using a text editor and add the line (/dev/hda1 /mnt/windows ...)at the end.

Then you can mount the file i.e mount /mnt/windows

Unless you are going to physically move the hard drive to the unix server it doesn't matter what file format you use. Since all the file translation is in the network filesharing drivers, a linux PC (with samba installed) can write to a NTFS filesystem just as easily as it can write to any filesystem on the linux PC itself.

You might find it easier to share a linux native filesystem with a network then trying to share a FAT filesystem if you need to use samba file permissions.

zc923 08-11-2003 10:20 PM

Ok, I was able to mount the drive partition. Now how do I get my linux system to appear in a Windows Enviorment. Lets call my windows workgroup "mshome". On all of my Window's pc's, i have NETBios enabled. How will I go about setting my workgroup, and NETbios in linux?

michaelk 08-12-2003 04:51 PM

To share files between linux PC's and Windows PC's you need to install samba. See previous thread for link.

You will also need to add TCP/IP protocol on the windows PC's.

What linux distribution are you running?

zc923 08-12-2003 05:25 PM

im running samba, and I have tcp/ip protocal running on my windows pc's. Im running Red Hat Linux 9

michaelk 08-12-2003 05:42 PM

Have you read any of the samba documentation?

Add a samba user (login as root)
smbpasswd -a your_windows_user_name
Enter a password

This should be the same as the user / password on your windows PC's as well as an existing user on the linux PC.

Edit the /etc/samba/smb.config file and change the workgroup to match your windows workgroup. Again need to be root.

Restart samba:
service smb restart

Now in a DOS prompt on your windows PC try the following command:
net view

You should see your linux PC. Look at network neighborhood if you see the linux PC you select it and then you should see the home directory of the windows user.

zc923 08-12-2003 07:23 PM

netbios name = Linux
server string = "Linux"
workgroup = MShome
security = share
log file = /var/log/samba.log
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
encrypt passwords = yes
wins support = yes

path = /tmp
guest ok = yes
writeable = yes

This is what my smb.config file looks like...yet it does not appear in my Windows network neighborhood or in the dos command result of net view.

michaelk 08-12-2003 09:59 PM

Add to your public share
Browseable = yes

On the linux PC in a console window try:
smbclient -L linux_hostname
Just press enter key when it ask for a password
(replace linux_hostname with actual computer hostname)
You should see the browseable shares being listed along with the netbios name, workgroup name and a bunch of other stuff.

To see of the samba is running
ps ax | grep smbd
ps ax | grep nmbd

Does it output a line
xxxx x smbd -D
xxxx x nmbd -D

If not look at the /var/log/samba logs and see if there are any errors.

If you selected the default firewall during install it might be blocking the windows PC from see the linux PC.

To flush firewall rules
iptables -F

All times are GMT -5. The time now is 12:06 AM.