Second Day Notes: Sharing a folder from Linux to Windows 10


Here are some notes about my experience sharing files from Linux so that my Windows 10 computer could access them. I’m going to try to make this useful but not give excessive details. It’s already going to be long!

The technology I used to share the files is called Samba. It uses the SMB networking protocol. According to wikipedia.org, the Samba name was chosen because it has the letters ‘S’, ‘M’ and ‘B’ in the same order as SMB.

These comments are about “second day” issues. I shared successfully on the “first day” by following tutorials. However, I forgot what was important. I couldn’t access the Linux computer when I turned the computers back on the next morning.

I’m using Ubuntu 18.10 and Windows 10. Other flavors of Linux may use different commands, but the principles should be the same. Other flavors of Windows might work in the Windows 10 manner, but I didn’t try.

  • On the Windows side, I want to connect to the Linux computer’s name, not its IP address.

    \\192.168.1.5\Documents bad.
    \\Sesqui412\Documents good.

    The IP address changes easily. The tutorials use an IP address, but that’s not the second day solution.

    I can also use net use L: \\Sesqui412\Documents to access the files as L:.

  • I don’t need the ‘samba‘ service running on Linux. I want the ‘smbd‘ service. This was a big rabbit hole. Once I gave up on the “samba” service and started using the “smbd” service, it worked correctly on the Linux side. I didn’t see any message online “Hey! you don’t want the samba service, you want smbd.” That would have been appreciated.

    This whole effort may have been completely unnecessary. if I had started with the smbd service instead of the samba service, I might have seen that everything was already correct from yesterday.

    This was a big battle. I was looking for information about starting samba. When I installed Samba
    sudo apt-get install samba
    I would get an error message
    "Samba is not being run as an AD Domain Controller: Masking samba-ad-dc.service".

    However, I didn’t notice the message right away. Reinstalling Samba with
    sudo apt-get install samba --reinstall
    let me eventually see the error. Trying to fix the message led me to a lot of grief and DuckDuckGo searches.

    There is a lot of information on serverfault.com and askubuntu.com about Samba problems. I found the basic commands to use are
    sudo systemctl enable smbd
    sudo systemctl start smbd
    To check for error messages, use sudo systemctl status smbd. Some references also suggest starting nmbd. I didn’t verify that nmbd is necessary but I used it.

    Again, to emphasize, this whole section is probably unnecessary. It was certainly “educational.”

  • I didn’t need to manipulate file permissions on the Linux computer. I didn’t manipulate any file permissions and they weren’t necessary to make the share work. Some online helps make chmod suggestions about that but I could safely ignore them.
     
  • Yesterday, I set up the configuration file /etc/samba/smb.conf. It was pretty straightforward. Network Administration: Samba smb.conf file describes options in the file. There’s also help at How to set up quick and easy file sharing with Samba.

    Some tutorials explain that when you change smb.conf, you need to run
    sudo systemctl restart smbd
    to activate the changes

  • If you find a tutorial site that gives a long story without explaining their purpose, try to understand the situation, not throw attempts on the wall and hoping they stick. (Disclaimer: This post isn’t meant as a tutorial, but rather some observations. For example, I don’t say anything about how I did the “first day”.)

    Two help sites that I feel are worth avoiding are http://social.microsoft.com/forums and http://ubuntuforums.org. If I see a link to either of them in a search result, I should keep looking somewhere else. Other resources are likely to have more “signal” and less “noise.”

    The three http://serverdefault.com, http://askubuntu.com and http://superuser.com are communities that are more likely to have reliable information.

  • The passwords for Samba use the program smbpasswd on the Linux computer. I had trouble with the passwords. This was the command to fix it. I’m not sure exactly what I did. I might have just used the wrong password.

So, on the first day, I got it working. On the second day, it broke. It was a lot of work fixing it. I hope these notes help someone else know some of the principles so that they can have a happier second day than I did!

Replace Windows 8 disk, phase 3


I was able to archive quite a few files.
* The files from a Linux server that I hadn’t saved
* The files from a 1TB drive from an old computer
I restored the files from the archived system onto that 1TB drive.

When I booted that restored system, the hard drive was making extremely loud seeking noises. I looked quickly at the drive performance statistics and they were the same as the original drive. I shut the system down and checked and the drive wasn’t damaged.

I was able to reset with the recovery partition and now I’ve got plenty to do and the system appears stable so far….

Replace windows 8 disk, episode 2


So, I replaced the disk that was ruining my system and got everything back to where I started. but…

… the new disk has the exact same symptoms… lots of data errors and seek errors, no bad sectors and 5 to 10 second average access times.

Now I need to do more sleuthing to find out if I’m just unlucky and got two drives with the same problem (which sounds really unlikely) or there’s some other problem going. The troubleshooting tool from the PC’s manufacturer didn’t find any problems which is a problem in itself. It’s really fishy.

I dusted off my Linux box that I hadn’t used for 5+ years. The goal with the Linux box is to not need to tackle Windows malware at the same time.

There’s some Linux bit rot going on because the display is stuck at 640 x 480. I’m fighting with the X configuration file but am not making a lot of headway. The auto-config dumps on me.

I’m finding clues that the Linux box had vmware installed on it. I can’t get it to launch. (It might be because of the screen resolution?) The old virtual machines I have scattered on backup discs are incompatible with modern vmware.

It would be awesome if I got vmware to work because I have antique versions of Windows (98 and Millennium edition) and antique versions of Microsoft Office (2000 and XP) that would be fun to play with again. I have a matching vmware install disk, but that’s for another day.