Problem with Simple File Sharing [SOLVED]

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
mikemmm
Level 1
Level 1
Posts: 16
Joined: Fri Aug 21, 2009 8:26 am

Problem with Simple File Sharing [SOLVED]

Post by mikemmm »

I have a small home network (one Mint PC, one Ubuntu laptop, and one Windows XP machine), over which I store and share a lot of data, mostly multimedia files. From the two Linux PC's, I have no trouble accessing the shared data on the Windows PC, but the reverse is not true - I can't easily share the data stored on my Mint PC with the other two machines. I tried "Simple File Sharing", selecting "Guest Access", and it couldn't have been simpler. Initially it seemed to work great, but after rebooting the file sharing had disappeared. I find that I have to enable file sharing every time that machine is started. Is this by design, or have I missed a setting somewhere?

Please take note that the files I want to share are not in my Home directory; I have a number of separate drives and NTFS partitions on this machine that contain the data that I am trying to share with my other PC's.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Problem with Simple File Sharing

Post by altair4 »

Initially it seemed to work great, but after rebooting the file sharing had disappeared. I find that I have to enable file sharing every time that machine is started. Is this by design, or have I missed a setting somewhere?

Please take note that the files I want to share are not in my Home directory; I have a number of separate drives and NTFS partitions on this machine that contain the data that I am trying to share with my other PC's.
Open Terminal
Type sudo net usershare info
I assume you shared them as sudo

I also need to see the entries in /etc/fstab that define how you are mounting the "separate drives and ntfs partitions".
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
mikemmm
Level 1
Level 1
Posts: 16
Joined: Fri Aug 21, 2009 8:26 am

Re: Problem with Simple File Sharing

Post by mikemmm »

Thanks for the quick response. Yes, I shared them as sudo, and they did actually work - I was able to play videos on my laptop from the hard drive in my desktop PC.

The net command gave me:

Code: Select all

$ sudo net usershare info
info_fn: file /var/lib/samba/usershares/stored data is not a well formed usershare file.
info_fn: Error was Path is not a directory.
info_fn: file /var/lib/samba/usershares/data is not a well formed usershare file.
info_fn: Error was Path is not a directory.
info_fn: file /var/lib/samba/usershares/music is not a well formed usershare file.
info_fn: Error was Path is not a directory.

etc/fstab contains:

Code: Select all

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda5
UUID=470d7f47-e93e-4dc2-bb2a-7e3a9f765f06 /               ext3    relatime,errors=remount-ro 0       1
# /dev/sda6
UUID=a04c071c-5ca3-40ac-9364-775ccb65e491 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
It doesn't even see the NTFS partitions. In the file browser, they show up fine, and after accessing each one, fstab now has:

Code: Select all

$ sudo net usershare info
[stored data]
path=/media/Stored Data
comment=
usershare_acl=Everyone:R,
guest_ok=y

[data]
path=/media/Data
comment=
usershare_acl=Everyone:R,
guest_ok=y

[music]
path=/media/Music
comment=
usershare_acl=Everyone:R,
guest_ok=y
And those partitions (there are actually more drives and partitions, but I haven't marked them as shared) are now accessible from the Windows machine. So, at least part of the mystery is solved. However (and I realize that this isn't really a networking question), why are the NTFS partitions, two of which are on the same hard drive as Mint, not accessible by Mint (or at least some parts of Mint) until after I actually access them in the file browser? I have my downloads set for a folder on one of the NTFS partitions, and I've noticed that downloading doesn't save anything unless I've previously accessed that partition in the file browser. I've noticed this same issue with my laptop running Ubuntu.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Problem with Simple File Sharing

Post by altair4 »

You have two independent and oddly related problems here.

The partitions you are trying to share are not being mounted at boot time. So you're forced to mount each one manually through nautilus each time you want to share them. That will work as long as you remember to mount first but it's not as automatic as I'm guessing you would like. The fix is to mount them in fstab so that it will mount at boot, then share them so everything is permanent.

The expert on fstab is Fred ( Auto Mount Partitions on Boot: http://forums.linuxmint.com/viewtopic.php?f=42&t=22093 ), but let's see if we can muddle through this together.

We need more data I'm afraid:

Open Terminal
Type sudo blkid

You should get an output that looks something like this:
/dev/sda1: UUID="DA9056C19056A3B3" LABEL="WinXP" TYPE="ntfs"
/dev/sda4: SEC_TYPE="msdos" LABEL="BOOTIT EMBR" UUID="CD32-0200" TYPE="vfat"
/dev/sda5: UUID="1EF42FA9F42F81DF" LABEL="VMOS" TYPE="ntfs"
/dev/sda6: LABEL="COMMON" UUID="C4DB-C1B0" TYPE="vfat"
/dev/sdb1: LABEL="Mint7" UUID="076426af-cbc5-4966-8cd4-af0f5c879646" TYPE="ext3"
You need to tell me which partitions you want to share.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
mikemmm
Level 1
Level 1
Posts: 16
Joined: Fri Aug 21, 2009 8:26 am

Re: Problem with Simple File Sharing

Post by mikemmm »

Once again, thanks. I appreciate the help.

The file sharing issue I could live with, since now I realize what it is and how to overcome it, but the other issue (with the same cause) is really more important. This is the computer that my wife uses, and she wouldn't remember to remember to click on the "Data" drive in Nautilus after booting up and before she downloads something. I never remember, either. :oops: If it's easy enough to get them mounted automatically, then I'll certainly want to try that.

Here's the output from the command:

Code: Select all

 sudo blkid
[sudo] password for mike: 
/dev/sda1: UUID="38C8ABEBC8ABA61A" LABEL="WinXP" TYPE="ntfs" 
/dev/sda2: UUID="B896F2F196F2AECE" LABEL="Data" TYPE="ntfs" 
/dev/sda5: UUID="470d7f47-e93e-4dc2-bb2a-7e3a9f765f06" TYPE="ext3" 
/dev/sda6: TYPE="swap" UUID="a04c071c-5ca3-40ac-9364-775ccb65e491" 
/dev/sdb1: UUID="1ABC295FBC293723" LABEL="Stored Data" TYPE="ntfs" 
/dev/sdb2: UUID="CC7047C77047B74C" LABEL="Music" TYPE="ntfs" 
If possible, I'd like to get sda2, sdb1, and sdb2 to be made available automatically. I have other drives I will also eventually share, but they are external USB ones and I turn them on only when I plan to use them.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Problem with Simple File Sharing

Post by altair4 »

(1) Lets do some clean-up first. We're going to remove your old share definitions:

Open Terminal
Type sudo net usershare delete data
Type sudo net usershare delete music
Type sudo net usershare delete "stored data"
BTW, you really shouldn't have spaces anywhere in linux. Things with spaces in it in linux are
always awkward to handle and it always trips me up. I'm going to work around the space issue.


(2) Create mount points for all the partitions you want to share.

Open Terminal
Type sudo mkdir /mnt/Data
Type sudo mkdir /mnt/Stored-Data
Notice I've replaced a space with a "-"
Type sudo mkdir /mnt/Music

(3) Create entries in /etc/fstab that defines how the partitions are mounted

Open Terminal
Type sudo cp /etc/fstab /etc/fstab.bak
This will create a backup of your fstab in case things get out of hand
Type sudo su
Now click on "Select All" , copy and paste each one of these into the terminal followed by an enter after each paste

Code: Select all

echo "/dev/sda2 /mnt/Data ntfs defaults,umask=000,uid=1000,gid=46 0 0" >> /etc/fstab

Code: Select all

echo "/dev/sdb1 /mnt/Stored-Data ntfs defaults,umask=000,uid=1000,gid=46 0 0" >> /etc/fstab

Code: Select all

echo "/dev/sdb2 /mnt/Music ntfs defaults,umask=000,uid=1000,gid=46 0 0" >> /etc/fstab

In case you're interested I'm deviating from Fred's howto in three ways:
The mountpoints are in /mnt so you don't get any mount icons on the desktop
I'm adding uid=1000 so that you own them and can share them as a regular user instead of as sudo
I'm using umask=000 so that you can allow guest access when you set the share.


(4) Reboot

(5) Go through the "Simple Sharing" thing again but this time you'll be able to do that as a normal user
and not as sudo. Make sure that you can actually share.

(6) Reboot to make sure that your shares are persistent
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
mikemmm
Level 1
Level 1
Posts: 16
Joined: Fri Aug 21, 2009 8:26 am

Re: Problem with Simple File Sharing

Post by mikemmm »

Oops! That didn't work. After rebooting, I can't get to those drives/partitions at all. They aren't listed in Nautilus either in Computer (like they were before) or in the Network. I can't find them in order to establish the sharing permissions. Perhaps you help me back out of those changes.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Problem with Simple File Sharing

Post by altair4 »

Press Alt+F2
Type nautilus /mnt/Data

EDIT: OR open your "Home" folder. Go to "File System" > mnt > Data

Can you see the content of "Data" ?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
mikemmm
Level 1
Level 1
Posts: 16
Joined: Fri Aug 21, 2009 8:26 am

Re: Problem with Simple File Sharing

Post by mikemmm »

Thanks.

I did that (mounted Data) and all three showed up under the Network in Nautilus. I set the sharing options on them and rebooted. All are shared now across my network, and that's great, but now this has introduced another problem - although I can now easily get to these drives from other computers, it's tougher to get to them on this computer. The three drives no longer show up under the "Computer" icon for Nautilus. I have to click my way through several screens under "network" to reach them. More importantly, though, the browser can't download to Data any longer - Firefox (and Opera) are both set to download to /media/Data/Downloads, and I guess that's no longer a valid path. There's no way to direct Firefox to download to a network drive.

Is there a way to resolve this? I like having our downloads set to a folder on a shared partition rather than within each user's partition. I also would like to have icons on the desktop for those three drives - I imagine that there must be an easy way to do that. After accessing each drive, icons appear on the desktop, but then they disappear on a reboot, of course.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Problem with Simple File Sharing

Post by altair4 »

Well that's my fault. I set those mountpoints that way because that's the way I prefer them. I should have asked first, sorry.

The way you have it set up now it will never show up in the starting "Computer" screen - that was by design. Once you migrate over to /mnt/Data for example you can bookmark it so it will show up in the left side of the "Computer" panel. As for Firefox change the path to /mnt/Data/Downloads.

But if you want icons on the desktop for these partitions then it's going to require the following:

Press Alt+F2
Type gksu gedit /etc/fstab

Change the following lines:
/dev/sda2 /mnt/Data ntfs defaults,umask=000,uid=1000,gid=46 0 0
/dev/sdb1 /mnt/Stored-Data ntfs defaults,umask=000,uid=1000,gid=46 0 0
/dev/sdb2 /mnt/Music ntfs defaults,umask=000,uid=1000,gid=46 0 0

to this:
/dev/sda2 /media/Data ntfs defaults,umask=000,uid=1000,gid=46 0 0
/dev/sdb1 /media/Stored-Data ntfs defaults,umask=000,uid=1000,gid=46 0 0
/dev/sdb2 /media/Music ntfs defaults,umask=000,uid=1000,gid=46 0 0

Then reboot.

You're going to have to share them all over again as well.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Problem with Simple File Sharing

Post by altair4 »

Sorry, it's not that simple - I'm getting sloppy.

You'll have to create new mount points as well

Open Terminal
Type sudo mkdir /media/Data
Type sudo mkdir /media/Stored-Data
Type sudo mkdir /media/Music
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
mikemmm
Level 1
Level 1
Posts: 16
Joined: Fri Aug 21, 2009 8:26 am

Re: Problem with Simple File Sharing

Post by mikemmm »

Thanks, I'll try that. If I create those new mount points, will I need to delete the old ones? And, if so, do I do that first or later?
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: Problem with Simple File Sharing

Post by altair4 »

You can leave them there for now.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
mikemmm
Level 1
Level 1
Posts: 16
Joined: Fri Aug 21, 2009 8:26 am

Re: Problem with Simple File Sharing [SOLVED]

Post by mikemmm »

Thanks. I made those changes, and it looks like everything is working great. The three partitions show up in the Places section of Nautilus, and they even have icons on the desktop. And I didn't have to change my download directory after all, since you had me move it back to being mounted under /media.

I really appreciate the help. I'm getting better at this....no, not at Linux. At following directions. :D
Locked

Return to “Networking”