Lost luggage

I have an old Acer Aspire 5742Z laptop, which in the grand scheme of things is known as ‘luggage’. It has a 320 Gb HDD that is probably becoming rather faulty. Both the Windows 7 and Linux Mint installations are crashing regularly and I have since reformatted it to hold Mint alone (no Windows – yay!). But… it still keeps losing data, checking the disk for errors and crashing..

So, let’s Backup any changes..?

I can’t afford a new hard drive for the old beast, so an online or network based backup system to restore the Mint installation with all of the changes  I have made or will make seems to be a super solution.

The Software Manager seems to offer no tempting solution with the terms ‘cloud backup’ or ‘backup’ apart from Dropbox, that I am already using for work data, so I opened the Synaptics Package Manager and searched again. This time I found two likely looking chaps: deja-dup and cinder-backup. So, I duly marked them for installation, applied, entered my root password and waited.

A sense of Deja-vu?

I couldn’t find cinder on my main men, but Deja-dup appeared with the name ‘Backups’, so I clicked on this. It then presented me with a window with 5 options:

  1. Overview
  2. Folders to save
  3. Folders to ignore
  4. Storage location
  5. Scheduling

All seems pretty reasonable. Overview tells me I have no recent backups and none scheduled. Two big hints 🙂

Folders to Save?

I want to do an entire backup of my Mint installation, so that seem to me like everything from ‘/’ (root) downwards. I clicked on the Folders to Save option and navigated to ‘/’ and then clicked ‘Add’. I removed the suggested ‘home’ backup, as I am after a complete system backup.

Folders to Ignore?

The next option is to choose which folders will be ignored from the backup set, and it suggests the Rubbish Bin (fair enough and the contents of my Downloads folder. Hmmm… that will have to go. If I download any PDFs or manuals or anything, I don’t want to lose them on a restore. So I click on ~/Downloads and then the ‘-‘ button and the option disappears.

Storage Location?

This is where you can enter the path to any location for your backup. I am going to use an external hard drive, but you could use a cloud or whatever in this instance. So I click on the ‘Local Folder’ drop-down and choose my external drive. I thne have to enter a path in a text fields so I enter:

/DejaMintBAK

as the path name (and cross my fingers!).

Scheduling?

Under scheduling the Every Week/Month/Day option is greyed out… strange? And the system wants me to save the backup ‘forever’. Ah, I see the problem- there is a big ON/OFF slider at the top of the dialog window and the backup is turned OFF, so I slide this to the ON position. It then gives me the choice of Day/Week for the frequency and I choose ‘Day’. At the moment, whilst I’m configuring the system, and I probably am going to lose everything due to hard drive crash I’m opting for greater security.

How to get it all going?

So, how to get it all happening? I assume that at a certain time a CRON job will kick it into action, but I’d like tosee the first backup happen now to verify that all of the settings are good. Back to the Overview screen, it tells me that the next backup is today and there is a big button for me to press to ‘Back Up Now’! Guess what? I’m going to press the button..!

And it fails… It cannot create the directory: permission denied.

I then create the directory manually  on the external hard drive, and run the Backup again. Fails with the same error message. Hmmm… maybe the ‘/’ option is global and it needs the mount point of the external hard point for an accurate path?

The full path is:

/media/<username>/<External HDD name>/DejaMintBAK

So I enter this into the ‘Storage Location’ text entry box, and (crossing fingers), try again!

Ooh, it looks like it’s working. Now’s it’s asked me for an Encryption Password, so I enter one….and Away it Goes!!

Woohoo!

Follow up – November 2015

Have tried for a few months now and the destination drive I have for backups is also faulty! (rats!) So far… no backup 😦

Advertisements

Linux Mint Beginner’s Guide

OK, I confess. I thought I’d stop searching the net for hints and tips, and bought the ‘Linux Mint Beginner’s Guide‘ by Jonathan Moeller, Azure Flame Media, 2012. It’s pretty cool and I sailed through the first ha;lf with no problems. All clear and only restating what I already knew.

Checking disk status

First I loaded System Monitor from the main menu. This is a GUI tool that shows me the status of my hard drive as well as the processes and resources that I have running. A bit like the old Windows Task Manager. I have used 33% of the HDD space, so I have plenty left. Now, ho to find the process in a terminal.

The top command used in a terminal shows me some really useful information that is updated in real-time. Looking through the processes I can see that there are no Samba (smb*) processes running, so that may explain why I have no sharing on my computer. ‘t‘ sorts the processes by CPU time, ‘l‘ by load average and ‘m‘ by memory used. If I wanted to I could kill a process by taking note of its number (the PID) and typing ‘k <PID>’. To test this, I launched the Image Viewer from the main menu and spotted the brand new process eog pop up in the top list in the terminal window. Cool. It has the PID of 3501. So, typing

k 3501

and then confirming the termination signal, does indeed kill the process. OK, I am armed for bear! ‘q‘ to quit and on with exploration.

df -h

Shows me a list of my attached devices, but I am mainly interested the hard drive which tells me I have 45Gb free and I’ve used 34% of the available space. Hmmm… I may have to use gparted later on to shrink the windows partition further and expand myLinuxx ext4 partition to get more space!

New, Improved Vim – for all those difficult stains!

Now I can learn to use the vi text editor from the terminal for quick and dirty configuration file editing! mwah-ha-ha! Just typing

vi

into the terminal launches a blank vim window; vim being the Improved version of vi. Using vi to call vim has already been established for me by the installation process – cool!

OK, the first problem is that the welcome screen tells me to press ‘q‘ and ENTER to exit vi, but it doesn’t work. OK, my fault – I didn’t read it properly, type

:q

and press enter. No problems. So, let’s try creating a text file by trypeing

vi test.txt

Apparently vi starts in normal mode with PAGE UP/DOWN, HOME & END moving about the file. I type in a dummy sentence to test and find that dw/de (no space) delete the word following the cursor, and d$ deletes to the end of line. OK, that works but I’ve deleted my test line so type some more in. I notice the backspace key doesn’t delete backwards but merely moves the cursor backwards. The cursor keys also do interesting things!!

dd deletes the entire line and p inserts the text from the last deletion at the cursor. Ah ha! So, I haz a copy/paste function! Pressing CTRL-G shows a status line and I can see that the file hasn’t been saved so it doesn’t exist yet. Pressing / for search is a handy way of moving around the document. Now to find out how to save the file.

Command me now!

Apparently I need to move from normal mode to command mode if I want to save the file. More later.

Samba administration on Linux Mint

So, we have out copy of Linux Mint (17.2) installed and it all looks very pretty, but it still isn’t talking to the other computer (Windows or Linux) on the LAN. Let’s try following the tutorial on the Mint site here.

  • An updated fresh Mint installed
  • Grabbed a copy of WINE for future Adobe Flash DRM video viewing with:
apt install wine --install-recommends

The tutorial then gives the following two commands, but I thought I’d check the Webmin site to see if there had been a webmin update (there had) and so changed the version number as seen below.

cd ~/Downloads
wget http://iweb.dl.sourceforge.net/project/webadmin/webmin/1.610/webmin_1.610_all.deb

So the source I changed to

wget http://iweb.dl.sourceforge.net/project/webadmin/webmin/1.760/webmin_1.760_all.deb

right, that’s downloaded the package. Now to get the rest of the supporting libraries:

sudo apt-get update
sudo apt-get install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl apt-show-versions libapt-pkg-perl -y

Both updates went through without a hitch. Now, I can go ahead and actually install Webmin:

sudo dpkg -i ~/Downloads/webmin_1.760_all.deb

Woohoo! Looks good, and the installation process also told me that I could login to webmin at https://dibbler:10000/ as root with my root password – ‘dibbler’ is the hostname of my machine. Alternatively, a more generic login would be:

https://localhost:10000/

Old Dibbler gets the panics!

A moment’s panic!! Firefox tells me that old ‘dibbler’ has seen an untrusted connection at this address! What do I do? Well, I’m fairly sure that this is just webmin as directed, so I click ‘I understand the risks’ and it wants me to add an exception to Firefox’s blocking rules. Wavering slightly, I do so and a pop-up does just that!

I chose ‘Get certificate’ and ‘confirm security exception’ – let’s hope those were the right choices!

Well, it all looks good – a login to webmin screen has appeared in my browser. I login as ‘root’ with my root password and go straight into the webmin options. Good grief! Where to start?

Webmin Administration

The first thing I notice on the home screen is that 13 package updates are available, so I click on the link to see if it will update them. Hmmm…. lots of GRUB stuff and some important kernel updates! Seems to be doing them ok… Yay! All good. Return to package list.

Using the Menu I went to Servers>Samba Windows File Sharing. There’s an awful lot of information here that I don’t understand, so I’m going to follow the tutorial steps pretty closely. I looked for ‘Add Samba User by converting a system user’…. In the second block of icons down, called ‘Samba Users’ there was an icon for Convert Users – perhaps this is what I need? I click on it. I checked the radio button for Only listed users or UID ranges, and then Use this password for newly created users.

Looking for the Verify option mentioned int he tutorial, I found the User Synchronisation section and checked the radio boxes for Add a Samba user when a Unix user is added, Change the Samba user when a Unix user is changed and delete the Samba user when a Unix user is deleted. It seemed to make sense that the users were synchronised. So, back to the main sharing menu. As the tutorial says, clicking on Samba Users does indeed show ‘nobody’ and my username.

I then chose to Restart the Samba Servers using the button at the bottom, and it failed! Damn! What now? Back to the tutorial… no help 😦

I restarted the Winbind server with no problem. Perhaps I can restart samba from the command line?

sudo restart smbd
sudo restart nmdb

Which all seems to go ok… but no luck!

Making file shares

Maybe I don’t have anything to share on the network? So, I went to the Create a new share option and selected my Downloads directory as a test but to no avail.

Not giving up yet, I went to the Windows Networking Options section from the main screen, put in my machine’s name as the server name and alias, changed the default service to ‘global’ (in the hope of catching any traffic!) and clicked Save. I used the above two commands to start & stop the service….  still no joy.

I then went to Security And Access Control under File Share Defaults. I changed the share to writeable as I wanted to receive files from other machines, made it accessible to Guests (user: nobody)and clicked save.

Sadly, still can’t get any networking working with either linux or Windows machines…

I will always Depend on you..

I started to notice that several of the Linux programs that I installed using the Software Centre were bombing out with messages about broken Dependencies, so let’s see if I can clean things up a little behind the scenes. Ubuntu is a DEB (Debian) based system, so the tool to use – it seems – is APT. A linux program is a collection of libraries referred to by a central executable, and these libraries (or dependencies) can be missing. These collections are called packages.

Opening a Terminal, the first thing I did was:

sudo apt-get update

to refresh the packages. After entering the password, a long list of sources scrolls by and told me the reading was done at the end. Awesome.

The version of apt-get I need to check dependencies is:

sudo apt-get check

Again, this seems to be alright. Hmm.. so does this mean my machine is clean? We’ll see….

Finding those little Orphans

Referring to an earlier post, I installed the Synaptics Package Manager from the Software Centre. Following its instructions, I installed localepurge and then deborphan. With localepurge, I could not select ‘en_UK’ as the system’s locale but I did find ‘en_GB’, so I chose that instead. I didn’t change anything else and the program was installed. Right, now onto deborphan. I searched for deborphan and found it along with gtkorphan, which is a GUI front-end to deborphan, so I marked both for installation (Right-click, select Mark) and then clicked on the Apply button. ‘Yes’ to all questions, waited, and then… I couldn’t find gtkorphan in the Applications Menu! Rats!

Going to System>Application Finder and then typing in gtkorphan, did bring it up though, so I clicked it and then the Launch button. It started and immediately show that I did indeed have a broken package associated with a broken Proprietry Driver! Yay!

So, I selected this and clicked OK, and got an error message about the dpkg database still being locked. Hmm… this is probably because Synaptic is still open. Now, I could close it and try again, but I thought I would go back to the original post that worked, so I closed all package programs and went back to the terminal.

sudo apt-get autoclean

and voilà! – a package gets deleted. Hang on though, it isn’t the one I expected. Nevermind, I’ll carry on with deborphan and use:

sudo deborphan | xargs sudo apt-get -y remove -purge

That should do it – a damn good purge! Rats again – this didn’t work, the -purge parameter has changed. So, by reading the error message it seems I should be using:

sudo apt-get -y autoremove

to remove about 20 packages it detected. Oh, and it did remove the driver package anyway so it’s not all a total loss.

Sorted.

Once more unto the breach, dear friends….

Ubuntu-Studio 15.04

It is time to have yet another go at getting the whole workhorse machine up and running with a nice, clean and – hopefully – stable Linux machine using the variant of Ubuntu designed to handle audio (and other media) known as Ubuntu Studio.

The main reason I use Windows rather than Linux is for the power of Windows editing apps and, to be honest, the games I occasionally play in the evenings. Having said this, if I can get all the work I need to do done in a Linux environment, a dual-boot machine might be the answer! At the moment, my main boot hard drive has gone down but it has allowed me to install Studio 15.04 from a flash drive  – woohoo!

Ubuntu Studio uses a Desktop based on the XFCE Windows Manager (which you can also see in Xubuntu) and so it is very clean and clear, albeit it somewhat cut-down and short of all the bells and whistles that mark the Gnome and KDE versions of Ubuntu. So, where to begin? Most of my data exists on external hard drives and additional hard drives in my main PC, so these need to be accessible to my (linux) machine and the other machines on my LAN (all Windows). To save you reading any further (other than for academic interest) – these steps failed!

Samba! Cha-cha-cha! Networking with Windows

Following the advice on the Ubuntu Help site, I shall try and set up the Windows networking in Linux using the command-line. I will just show you the commands I used here and my comments for brevity. for explanations, follow the link and read the chat 😉

To start, I shall try to switch to Superuser mode as I am going to be doing a lot of Root work. So:-

sudo su
<enter password when requested>

This logs me in as root! Yay! Then:

apt-get -y install samba

to install the ‘samba’ sharing software…

smbpasswd -a <user>

to create a Samba user. You’ll be asked for a new password for the Samba user (I used the same username as my normal one), and then to confirm it. The next instruction is to create a Directory (folder) to be shared. I assume all of my external HDDs can be linked to in this directory.

mkdir /home/<user name>/<folder name>

so as my everyday username is ‘gary’, I chose the following:

mkdir /home/gary/shares

Updating Configurations

Now we can go about setting up the samba configurations… First to make a copy of the samba configurations file (samba.conf) to our home folder.

cp /etc/samba/smb.conf ~

Open the configurations file and then

gedit /etc/samba/smb.conf

Now to add the Words of Power to the end of the conf file!

[<folder name>]
 path = /home/<user name>/<folder name>
 available = yes
 valid users = <user name>
 read only = no
 browseable = yes
 public = yes
 writable = yes

where user name and folder name are those we decided on earlier. Remember linefeeds and spaces are all important here. Now save and exit.

Ooh! Exciting times! Time to restart and test

Type the following to restart the samba system:

service smbd restart

Oh, that seemed to go well. We can test it with:

testparm

Lots of information, but I noticed “loaded services file OK” and my additions have been listed at the end of the dump. Woohoo!

Now for the Client

That’s the server installed, and it’s now time to install the Client.

apt-get install smbclient

Seemed to go OK. Hmm.. how to proceed from here though? It’s a little unclear. I did figure out that the Domain name of the samba share is ‘WORKGROUP’, so that’s pretty handy. Using:

smbclient -L //<my @pc name>/<folder name> -U <user name>

shows me a list of shares that my samba user has available to use and from that I can see the other machines on my network and the printer. I’m not sure why my Linux machine does not have a name though…

Is this your vehicle then, sir?

I’ve just spotted that the ‘shares’ folder I set up has the owner ‘root’ (because I was typing everything as a Superuser) so I may need to change the ownership back to my samba user, ‘gary’, before it will work. So, to do this I typed:

chown gary /home/gary/shares

which did the job. ‘gary’ is my local username, and ‘shares’ is the <folder name> we have been using so far. Using the File Explorer (Thunar in my case), I could right click on the folder icon and see that owner was now me (‘gary’) but the group owner was still ‘root’. so using the drop down I could change the owner to ‘sambashare’ (that seemed like it might be the right thing to do) with Read/Write permissions. I allowed it to apply the permissions recursively as well.

Exploring the Network

By clicking on ‘Browse Network’, I was shown a ‘Windows Network’. Clicking on this, showed me a ‘WORKGROUP’ folder. Opening this, brought up a password dialog. So I entered <username>, Domain was already ‘WORKGROUP’, and my samba password. Rats!!!! Failure. It did not open the workgroup for browsing.

 

Hmmm…..   back to the drawing board 😦