Netbook Server – Sharing An External Hard Drive In Linux

So if you have followed my instructions, you now have a:

Computer that runs Debian Linux
http://www.ramblingmoose.com/2016/02/the-netbook-server-installing-debian-or.html
Computer that you can look into using Remote Desktop
http://www.ramblingmoose.com/2016/02/the-netbook-server-you-need-to-be-able.html
Computer that you can share part of the local hard drive
http://www.ramblingmoose.com/2016/02/the-netbook-server-how-to-actually.html
Congratulations.  You now have a file server!

If you followed those directions, it also installed a bunch of other programs that will let you do other things.  I noticed that something called “CUPS” was installed, and that will let you plug a printer into the same machine and act as a “Print Server” or a “Network Printer” – if you can find the instructions on how to configure it.

Debian and Raspbian both come with enough that you could use that machine as your one and only daily driver computer.  The browser is called “Iceweasel” and is Firefox, rebranded.  You have Libre Office to write letters, work with spreadsheets, and make presentations that are all compatible with Microsoft Office.

Yes, it really is, I use it every day.  No, you don’t have to pay for it.  Ever.

There are more apps, and I would suggest looking into some of the software that is out there, all free.  If you start “synaptic” from your terminal as root or “sudo synaptic &” you will find so much free software that your mind will fog up and get tired before you find everything you want.

But that all is just the preamble to this discussion.  You came here to share an external drive.  This is like any other shared drive on the network, you have to have it plugged into the server (USB Port on your netbook), you have to tell the computer where it is, and you have to tell it how it is to be shared.

Remember, I am trying to write this for a Windows audience so I’ll go as basic as I can.  You Windows folks are in a new world, and you will want to have this go well.  If you are a Linux expert or even intermediate, you may find this needlessly wordy.   Not to worry, you’ll be right.

One Step At A Time.  Divide and Conquer.

First step – Make sure you can read the drive from Linux.


Before you get anywhere, start the computer.  Log in.  Get to your desktop.  Then plug in the drive.

Start your terminal session by clicking on the (start) “Applications Menu”, then click on Terminal.  Sign in as root by entering “su” and your root password.  You will eventually need this

Now, launch the file manager by clicking on the (start) “Applications Menu”, then click on “File Manager”.

In the left pane of the file manager you will see Devices, Places and Network.  In “Places” your external drive will come up with a little eject arrow to the right of it.  Click on the icon for the drive.  A little wait icon will start to rotate.  When it is through it will do one of two things:

Success is if you are dropped into a view of whatever files are on the disc.  It means that all the drivers are in place.  Most likely this drive is something called “vfat” or “fat32”.  Remember this for later.

Failure is if you get a big ugly warning message up.  That means that you don’t have the drivers for the format that the drive has on it.  Most likely you will have to install the set of drivers called “ntfs-3g”.  This would be where your external is a really big drive and you did it to make things faster.  To install that do the following steps:

  1. apt-get update
  2. apt-get upgrade
  3. apt-get install ntfs-3g
  4. shut down the server
  5. unplug the drive (It isn’t shared yet and you don’t want to wait for the computer to release it)
  6. start the server
  7. and plug in your drive when you have logged back in to the desktop, terminal, and file manager.

No matter what, at this point, you should be able to read your external drive.

You also need information.  When you worked with the server software “samba” you created a user and a password, and you will need that later.
 

Next step – finding where Linux thinks that drive actually is.

Here is where Linux people will be saying “gparted“.  If you know how, go for it, this is the slower but less risky method.

To determine what is plugged into your machine type into the terminal:

  • dmesg | tail -30

Linux keeps a log of whatever is important to the system.  Since you “just” plugged that external drive into the computer, the last thing on that very long stream of text will be what was reported when the computer detected the hardware.  The “tail” bit will tell terminal to just show the last 30 lines of what are in the display of messages (dmesg).

The clue there are the lines that say “usb 1-2” and “sdb”.  When I plugged in the drive, it said “new high-speed USB device number 2”.  So what we’re going to tell the system is that the drive is sitting on a device called sdb.  The partition we will be using will be the first one, so it is officially “/dev/sdb1”.  In windows, it would come up as your D drive if there is no DVD/CD drive present, E Drive if it is, this is the same thing.

Since my stick is formatted to be removable on Windows, it is a format that Linux calls “vfat“.    My big 4 TB drive is formatted NTFS, so I would have to mount it as “ntfs-3g

Create a place to store the data in.  In my case, it is “/home/bill/external“.  You should change “bill” to the name of your user that you logged into when you started this exercise.  To make the directory, open terminal again as a regular user and enter this command:

  • mkdir /home/bill/external
  • chmod 0770 /home/bill/external

You just created the directory and set it up so that you and root can use it.

There is one file that you need to edit in Terminal with the following command:

  • nano /etc/fstab

This file tells linux where all of your disc drives sit, so be careful and don’t delete anything.  You will be adding a line, as below:

  • /dev/sdb1 /home/bill/external vfat defaults 0 0″

That says – put the external drive’s first partition “in” the /home/bill/external directory.  It also says that it is “vfat” format so change that if it is an ntfs-3g format.  The defaults are lengthy and you can go into them in great detail on the Wikipedia Article.

If you wanted to go further and add multiple partitions for other people, you could do it in /etc/fstab by adding multiple entries.

Once you restart the computer, you should be able to find the drive on Windows, and you are on your way.  Just find the drive in Windows File Manager, enter in your login from Linux, and you’re good to go.

One final wrinkle

What this does is to “bind” the external hard drive or memory stick to the server.  It is now set to automatically mount and share the drive whenever the power comes back on.  If you do not have a drive plugged in, Linux will boot, but put you into a terminal session as root into what is called “Single User Mode”.  You can do the following edit at that point with the commands below.

To remove the hard drive so that the server is no longer looking for the drive at boot, in terminal as root:

  • nano /etc/fstab
  • find the line with the external drive and enter a # as the first character in the line
  • save the file and restart the computer

This now turns your server into a machine that only serves the local hard drive.

I’m Sorry, It has Six Months To Live. Windows XP Is Dying.

Sure, lets be melodramatic for a bit.   I kept thinking of a doctor’s office with dark walnut book cases and the doctor talking to the patient in hushed tones. 

I guess I watch too much TV. 

We had this discussion last night.   Sitting on the bench, Bill, Kevin, and I, and our dogs Rack and Ellie, were watching life go by.  Bill’s Mom, Lisa, has an aged Windows XP computer.   We may be able to get some more use out of it by adding more memory since it only has 1 GB.  Maybe not.  But the thing that most needs to change is Windows XP.

On April, 8, 2014, Windows XP support from Microsoft will end.   Customers who pay lots of money will get support, but that won’t help you since Microsoft won’t be sharing that with the world. 

All of the dates for the end of life of Microsoft Windows are on this page.  You are safe with Windows 7 until 2020, although I suspect that you will find your software won’t work with it near the end.  Things might get a bit “weird”.

There are reports of people writing viruses to be set out into “the wild” on April 9, 2014 to create havoc.

Bot-nets, Trojans, and Viruses, Oh My! 

The result is that if you are running XP on your computer on that day or later, you really need to change that to a newer operating system.

So there’s the typical decision tree:

If you don’t need it, recycle the computer or pass it on to someone who can do that for you.  Problem solved!

If you still think you can use it, or you must keep it for “records”, or you’re just one of those paranoid people who can’t stand the idea of your old hard drive falling into someone else’s hands, you may be able to upgrade it.  Just don’t get onto the internet with Windows XP next April.  You’ll have a bad time of it, eventually.

Bad boys, Bad boys, What’cha gonna do when they come for you?!

Ok, so how do you know whether to upgrade?  If you really want to know, here’s a great oversimplification of things, but basically:

  • Windows 8 will work on a machine with 4GB of memory but if you are looking at a computer with XP on it, you’re going to be shocked when you start it with Windows 8.  You might want to stick with Windows 7.

  • You can install Windows 7 or Linux if you have 2GB of memory, an Intel Core Processor, or newer.

  • Assuming you need to keep the software and data on the computer, and your older computer has 1GB of memory and won’t take any more than that, Windows 7 Home can be installed, but it may be slow.  You probably won’t want to use it for much more than that “archive” look around for your old records or recipes.

  • If you don’t need the data and you’re comfortable with playing with new software, look into Linux.  Specifically Ubuntu Linux.   All the software you will need for normal “office” or “web surfing” use is free, including Libre Office to do what your Microsoft Office did for you.  One thing to consider with Linux is that there are very few viruses on Linux.  I don’t even run a virus scanner on my Linux laptops.

  • With older computers it gets more complex, but basically Linux will be your only option to use the machine on the web.  If the computer can’t take 1GB of memory, you really are limited.

Checking your memory is easy.   Start, find “My Computer” and right click on it.   Select Properties and it will be there for you.  Whether your machine can take more than what it has in it is another story, and you will have to do that research on the computer vendor’s website.  Good luck there, there are way too many combinations to fit in the scope of a blog article, so I can’t be all that specific.

Personally I have a mix of things here.   My older machines are either Linux or Windows 7.  While all of my computers are old, and some as old as 10 years old, I haven’t had to throw any out due to this XP thing – they’re all still serving a purpose.  Basically, this is the process I’m going through here as well.   Remember your mileage will vary and one size doesn’t fit all, you’re going to have to actually think this through, but it isn’t that tough, I’ve got faith in you!

Need Excel or Word? Try Libre Office Free

Sure, it’s written like a spam or a sales document but the truth is that most people won’t need anything else and yes, it it is completely free.  Libre Office, is a complete office suite, and it really is free.

Ok, why am I talking like a salesman?  Simple, someone asked me if they could “borrow” my copy of Microsoft Word.  6:45 AM in the middle of my dog walk.  I told them to check my blog today for links for downloads for Libre Office instead.

First, you don’t really borrow software, you do that and it is considered piracy.
Second, you don’t really need to spend the money for a word processor or spreadsheet program when there is an excellent free piece of software out there.

Yes.  Free.

As in Free and Open Source Software.  “FOSS“.

Keeping this simple, basically “FOSS” works.  People do write software to do things and sometimes it is put out there for everyone to use.  You know, good guy stuff?

In the case of Libre Office, you can replace Microsoft Office with it.

Word is replaced by Libre Office Writer
Excel is replaced by Libre Office Calc.
Access is replaced by Libre Office Base.
Powerpoint is replaced by Libre Office Impress.
and Visio is replaced by Libre Office Draw.
They also have something called Libre Office Math, which I believe is a replacement for Mathematica but I don’t have any experience with it. It lets you solve equations like the ones you had in Algebra and Calculus by typing in the formula.  Don’t tell your high school kid but it should solve their homework for them.

Now, if you are a professional, you’ll realize that in certain cases you simply can’t use anything else.  Your IT Department decided this is what you’re going to use.  Go for it.

But if you are like the majority of computer users, on Linux, Mac or Windows, all you really need these days are a good browser and an occasional Word Processor and Spreadsheet.   The rest is overkill but hey, it’s all free.  They do make their money by donations, so if you’re fully employed you might want to drop some money in their tip jar

Think about it, Five Bucks for a Microsoft Office Work-alike Replacement.  Pretty cool, huh?

I use it on my machines here, Windows, Mac, and Linux.  In fact it came free with Linux Ubuntu, I didn’t have to think to install it … there it was.  It’s on my CentOS Linux Server that I’m building right now.  My Linux People will know – Synaptic has all this stuff for the asking on Ubuntu and Debian. I loves me some Synaptic!

The thing is that even the output files that you create using Libre Office are the same format as those out of the more popular programs like Microsoft Office.  The only rub is that you have to make sure you tell it to use the docx or xlsx formats when you save, or configure Libre Office to do that once and for all.  I forget once in a while and then get a little confused as to why my resume is not in docx.

The download page is here.  Like I said, you don’t have to pay for it.  It’s free.

It Hasn’t Hit The Market Yet But Windows 8 Has Been Pirated

I don’t know why I am surprised.  I guess Microsoft has the same problems with security as every other large organization.  But if you hunt around, Windows 8 has already hit the pirate Bit Torrent sites.

No word whether they found a way to fix that ugly “Construction Paper” interface.

Not mocking Microsoft at all, people pirate software for their own reasons, and there had to be an insider on that. 

There are alternatives out there for your trusty computer although most folks would not consider them because of lack of training or even being aware that they exist.  It’s a bit sad though that the software has not earned Microsoft a penny yet and people have already put it out on those sites.   Not quite fair is it?

I’m a big fan of open source software.  This particular machine is an Eee machine, a wee little thing that came to me without an operating system or any software at all.  I installed CentOS Linux, then Libre Office came with it, Skype and a few other pieces of software, all of which are free or open source.

FOSS – Free Open Source Software.

FOSS takes a bit of getting used to, but if I need anything to make this particular little machine run, I can get it without resorting to theft.

On the other hand, the graphics programs I use to put those pictures up with those annoying watermarks (I’m sorry, really I am) are FOSS and I can use them on my Mac or my Windows computers.   I use Gimp and Inkscape and they both get the job done quite well and work with accepted industry standards.

For the rest of us, Windows 8 will be released to the stores in October and you can decide then if it is for you.