Further Adventures With Linux – Reinstalling Windows 10

In July 2017 my son’s HP laptop stopped booting. We tried to repair and reset it using the utilities obtained by pressing F11 during startup, but these didn’t help. Diagnostics indicated the problem was with the hard disc. I decided to try a clean W10 install before buying a new hard drive for the machine. My reasoning was that a format might remove disc errors caused by software problems and skip physical bad sectors caused by (say) a disc head crash. I’m not sure how valid this is – but it seemed worth a try, and it worked, giving him a neat new system at no cost.

So here is an brief account of what I did, in case any of you have a similar problem.

1. Get a W10 image

This is easy – you just download it from Microsoft as a .iso file. I picked the latest 64 bit version, to match the laptop, but you might need something different. It can be installed onto any machine with a Windows licence, and will activate when connected to the internet (see 5 below).

2. Back up files

I booted the machine with my live Linux multiboot stick (see Linux note 1, below) and copied the documents, photos and music to a portable hard drive. Remember a live Linux system can read files on the hard drive even when it can’t write to them.

3. Create a bootable W10 usb

I did this on my desktop machine under Linux Mint (see Linux note 2). I downloaded and used woeUSB, which is specifically for creating Windows usbs. As a precaution, I formatted the stick (NTFS) beforehand. For details, see

http://www.omgubuntu.co.uk/2017/06/create-bootable-windows-10-usb-ubuntu

4. Reinstall Windows

The usb is not ‘bootable’ like a Linux live usb – so you can’t run Windows from it directly. It is an installation source only. I chose to reformat the hard drive during the installation, following the method at

https://technet.microsoft.com/en-gb/library/dn336946.aspx

In outline, this is:

  1. Insert the usb, then boot the PC into UEFI mode by hitting F11 while it starts up.

  2. Choose to boot from usb (this actually means to install Windows!), then select Custom installation type.

  3. You now get a list of partitions. DELETE them all, one by one, to leave a single large block of unallocated space. Scary!

  4. Select this space and install Windows. The process will format the drive correctly as it goes. The machine had to be restarted several times, and it took a little while, but it worked. Result: a completely clean version of W10, with no bloatware. You know you’ve got there when Cortana starts talking to you.

5. Activate Windows

This happens automatically if you put Windows onto a drive on a machine that already has a licence and connect it to the internet. Very smart of Microsoft! It should work with a brand new disc drive, as well as after a reformat.

6. Add software and data

You get a completely clean OS, with no extras. Windows Firewall and Defender are up and running, and you have Edge (and IE), plus the usual system tools and accessories, but you don’t get any of the extra bits that might be bundled with a new PC. There is an option to ‘Get Office’, and when we clicked on this the system recognised that my son had a licence for Office and let him download it again. Once more, very smart. You will also need to put back the data you backed up. This is a good opportunity to decide whether you really want to clog up your system with all those old memos and photos…

And that’s it – a clean, uncluttered Windows 10 installation. It’s not a quick job if you have to back up all your data and format the hard drive, but you can do it all with GUI based tools and patience.

Linux Notes

1. Multiboot stick

My current live Linux usb stick has Puppy Linux, Porteus, LXLE and Knoppix on it. Of these, only Puppy worked with the laptop in its original state when I wanted to recover the files. I think this might have been because I had ‘secure boot’ enabled in UEFI  (See below for more on UEFI). This prevents malware from loading at boot time, but can also block things you want, like Linux live distros. My guess is that Puppy slipped round secure boot in some way – but I don’t know how, and the Puppy Linux website doesn’t make any claims in this context!

SO….. if you want to use live Linux to recover files, reinstall Windows etc., it could be worth turning off ‘secure boot’ first. Just remember to switch it back on once you have finished. I turned it off later in the process, and the installation did NOT automatically turn it back on.

Having said that, web threads suggest this is a rapidly changing area. Many recent Linux releases will work with UEFI, and many recent UEFI PC setups will (allegedly) allow Linux. Suck it and see!

2. Linux Mint and LXLE

In an earlier post I mentioned using Pinguy Linux. I switched to Linux Mint this spring in order to get the latest version of Ubuntu. Highly recommended. I am also running LXLE as a second operating system on my Vista laptop. This is a fully featured lightweight distro, with (for example) a full suite of Libre Office. Worth a look if you want a live system with decent office tools and you have enough RAM.

BIOS/UEFI and MBR/GPT

Most PCs since W8 use UEFI (unified extensible firmware interface) instead of BIOS (basic input output system) as the lowest level of control. I therefore had to make sure that the C: drive was formatted correctly for UEFI, and the easiest way to do that was the partition deletion procedure described above.

The old MBR (master boot record) partition system doesn’t work with UEFI, which requires GPT (GUID partition table) partitioning. The W10 installer creates this automatically if you give it free space to work with.

Launching UEFI interface

The usual way to do this is to interrupt the boot (with F9, F11, Esc…. – it depends on your computer make and model), but you can do it from a WORKING W10 system by clicking on the ‘off’ symbol, then holding down shift while clicking restart. This gives you the UEFI menus when the system restarts.

You then have options to reset or repair the computer, and other things such as advanced options, which eventually gets you to something like the old BIOS interface where you can set the order of boot devices, turn the fan off, disable/enable secure boot etc.

Recovering a hard drive by reformatting – a good idea?

We rescued the laptop without ever having any idea as to why the hard drive was failing in the first place. The system logs showed there had been occasional drive errors for about a year. My son confirmed this, but only involved me when the machine would not boot at all. Okay, he was away at university, but even so….

The elephant in the room is what will happen next. So far (six weeks on) the laptop is working fine, and we have had the talk about backing up as you go along, which to be fair he has always been pretty good about. It is also not his work computer, so a bit of down time would not be a complete disaster. But nevertheless there is the possibility that the disc errors were caused by something physical like dirt or a head crash, in which case it is likely that they will recur.

My feeling here was that we had nothing to lose, and I was quite prepared to install a new hard drive as a last resort. They are not all that expensive and, depending on your computer, fairly easy to switch. Your local repairer should charge considerably less than £100 to supply and fit one for you if you don’t feel up to doing it yourself. We were successful, but if the drive packs up again I will probably replace it. I already have the Windows image to put on a new drive.

If you are having hard drive problems, ask yourself how much data is on there that you absolutely cannot afford to lose (and why you haven’t backed it up!). Also consider the amount of time you are losing to drive errors. In my son’s case the laptop was eventually unusable, but it didn’t start that way. If the risk or the overhead is unacceptable, replace the drive. If not, you might like to try a format and reinstall of Windows…. And maybe start copying everything to the Cloud!

Advertisements

Going Live With Linux

I’ve been pretty happy with Windows Vista.

There, I said it. Duck me in the village pond then burn me at the stake.

I bought a HP Pavilion dv9000 laptop with Vista preinstalled when it was brand new. I nearly had the shop give me XP instead, but then I thought about future support and upgrades and the hassle of keeping an old system going against the grain… So I accepted Vista and, after the ups and downs of the first few months, it has served me well. I’ve used the laptop for work and basic web surfing and shopping, and it’s still my typewriter of choice for large projects.

A year ago, I installed Pinguy Linux on the family desktop (in a partition alongside the kids’ old Vista machine, which nobody ever uses but I’m not allowed to get rid of) and since then I hardly connect the laptop to the internet. It’s still fine as a standalone office machine, but can be desperately slow on line. And then there’s all the endless updating. Pinguy has everything I need for day to day work, runs fast and updates in a couple of minutes if you do it regularly.

I tried running the laptop from my Pinguy installation disc in live mode. For anyone unfamiliar with the jargon, this means the operating system runs in RAM and nothing gets written to your computer drive. Great for testing. It worked, but not well. The laptop only has 2Mb of RAM, which isn’t enough for a full Pinguy system. My live/install version of Pinguy also lacks the Nvidia drivers the laptop needs, so I had to edit the boot parameters to force vesa. (I’m not going to explain this – there are lots of good threads on the web if you need help on editing the boot string in a Grub menu. Besides, the whole point of this article is to ensure you won’t have to!) I considered partitioning the hard drive, but was unable to free a decent amount of space without manually resizing partitions. I chickened out at this point – I have a clean and useful Vista system which I still use regularly for writing and things like Graph (https://www.padowan.dk/download/ ) that don’t run under Linux (I’m not a fan of Wine), and if it ain’t broke I prefer not to fix it.

At this point, I asked myself what I really wanted. The answers were:

1) Vista working on the laptop. (So leave it alone!)

2) The ability to connect the laptop to the internet without too much fuss and updating. (Won’t do this often, but never say never).

3) Getting Linux working on the laptop. (Pride!)

4) Trying a few other Linux distros. (I love Pinguy, but you can’t help being curious.) ‘Distro’ is shorthand for ‘distribution’ – in other words a particular bundle of Linux and associated software.

The obvious solution was to create a multiboot usb stick, with a selection of lightweight distros, and then have a play. The rest of this article describes what I did and compares some features of the distros I tried.

First a little technical caveat. My laptop is a HP Pavilion dv9000 with 2Mb of RAM, an AMD Athlon X2 64 bit processor and an Nvidia GeForce7150M/nForce630M graphics processor. And I’m an ordinary computer user, capable of reading a help thread and a manual, and typing commands at a terminal prompt, but no kind of tech guru. So there are probably lots of better ways of doing the job, and a different machine might need different things. This worked for me and I hope it works for you, but no guarantees, OK?

Choosing Distros

I wanted an operating system light enough to run in 2Mb of RAM and with appropriate Nvidia drivers installed as standard. It should allow me to connect to the internet (wirelessly if possible), check my email, edit a document locally or on the Cloud and watch video on You Tube. I expect to have to tweak a live system a little before actually using it, for example to turn on a firewall, but the less the better.

After reading lots of reviews (and this is my way of saying thanks, guys) I decided on the following:

Puppy Linux:    Puppy 5.2.8 Lucid from ibiblio.org via the link from

http://puppylinux.org/main/Long-Term-Supported%20Puppy.htm#lucidpuppy

Kanotix:   Kanotix Dragonfire LinuxTag2013 LXDE version from

http://www.kanotix.com/changelang-eng.html

PCLinuxOS.    The lxde 2014 version via the website

http://www.pclinuxos.com/get-pclinuxos/

(I used one of the Irish mirror sites for the download)

Lubuntu.     The 64 bit AMD version via

http://lubuntu.net/blog/lubuntu-1504-vivid-vervet-released

Porteus.     Porteus is a bit different. You specify in advance many of the things that other distros require you to set or install after booting. Go to http://www.porteus.org/ and follow the instructions.

I chose the LXQt desktop, Nvidia Legacy drivers and Firefox as defaults, and said ‘No’ to things like a VOIP client (for Skype) development tools and printing support. This gave me a very lean system.

A couple of general points.

I chose a light desktop – so LXDE or LXQt rather than KDE. However, the distros are so light in general that I am fairly sure you could go for KDE without having a huge impact on performance.

I saved the .iso files (the images of the OS) to a sub folder in my Downloads folder, just to be tidy. The file sizes were: Puppy Linux 139 Mb, Kanotix 785 Mb, PCLinuxOS 715 Mb, Lubuntu 724 Mb and my basic Porteus distro 260Mb.

As you can see, Puppy is the smallest by a good margin. Lighter distros exist, but I wasn’t confident they would have everything I wanted.

I have a 64 bit machine, so I chose 64 bit distros even though I only have a 32 bit version of Vista. All the above distros come in 32 bit flavours if that’s what you need.

Creating the Multiboot USB

I used Multisystem LiveUSB which has a version designed to run in Linux, as I wanted to create the boot usb on my Linux desktop machine. Other options are available if you are working with a Windows system.

(NOTE Multisystem is French software, but their website translates into pretty much any language you like, including Welsh. Da iawn a ddiolch, ffrindiau! If you don’t want to download your own distros, they will sell you a stick with a selection already installed. If you are following what I did, you won’t need to go there at all).

1) Search for MultiSystem LiveUSB.

2) Follow the link to pendrivelinux.com:

http://www.pendrivelinux.com/multiboot-create-a-multiboot-usb-from-linux/

3) The window now has all you need. Click on the download link in paragraph 1, then follow the instructions. The installation shell script will be placed on your desktop and when you run it the package is installed. This takes a few minutes. In my Pinguy setup, Multisystem ends up in the Accessories section of the menu. There is also a tool to test an iso file, which I didn’t try but might come in handy.

4) Once you have installed the software, follow the instructions in the lower half of the window to create your usb drive. Some additional pointers (please bear in mind I was doing this from Linux, not Windows):

  • I had to format my new usb before Multisystem would recognise it. I used the Ubuntu ‘Discs’ utility to create an 8 GB partition on a 16Gb stick, give it a label and mount it, after which Multisystem detected it immediately. The five distros I installed, plus the associated tools that Multisystem includes, came to about 2.7Gb in total, which is 100Mb more than the sum of the .iso file sizes. So you don’t need a massive usb stick.

  • The device came up as /dev/sdf1. This will probably be different for you – make sure you are installing to the correct place!

  • Open a file manager alongside Multisystem, then drag and drop your .iso files from there. (There is no built in ‘browse’ facility.) This needs a root level (sudo) command so you have to enter your root password each time.

  • The copy runs in a terminal window, and what you see varies from distro to distro. BE PATIENT – it will take several minutes for each distro.

  • Just quit at the end. There is no ‘finalise’ step – so I suspect you can add more distros later if you want, although I haven’t tried this.

Booting from the live usb drive

Insert the drive, then start your machine. As it begins to boot, press F9 (on my two computers) a few times to open the boot menu and choose your boot device. On my desktop, it is recognised as ‘USB Pen Drive’ but on my laptop it is ‘USB Hard Drive’. Consistency, thy name is Hewlett Packard! If you are going to be booting from the stick often, it would be worth editing the BIOS to choose the appropriate drive before the hard disc, but I advise checking first via F9. (I edited the laptop BIOS in advance to choose pen drive, which didn’t work. Took me a while to figure that one out).

P1000139

You will now see the Grub menu (something like the photo above), giving a selection of Linux installations and some other system tools. Simply pick the one you want and you’re in business. Lubuntu gives you the choice of booting live or installing the software (choose ‘Try’ to begin with), the others just boot up. If you like what you see, you can install it later.

NOTE The photo shows Kanotix, Lubuntu, Puppy Linux, and PCLinuxOS as the first four entries.  Porteus is displayed as Syslinux. Select this to get another screen, then press Enter when Porteus is highlighted on the top line. My installation prompts for ‘Always fresh’ (i.e. don’t save anything) during startup. There is an option to preselect this on the Porteus menu screen, but when I tried that the boot ran part way, then hung. So just press Enter.

As you would expect, the lighter distros boot faster, but none of them takes more than a minute for me except PCLinuxOS, which requires about 2.5 minutes. They all shut down very quickly, unless you have applied an option to save settings.

First Impressions

First up, they all work. You get a functioning Linux system that you can adapt to your needs. They all connect to the internet if you plug them in. And they are FAST – especially compared to a creaky old Vista system. Puppy is so fast that you might have to reduce the mouse sensitivity to stop it selecting things all by itself as you pass over them.

I’m not going to say much about appearance, as you would want to customise all of them for extended use. PCLinuxOS, Lubuntu and Porteus have modern minimalist desktops, all nice looking and easy to use once you learn where everything is in the menu structure. Puppy Linux puts icons on the desktop for the most common tasks which I found helpful to begin with. Kanotix reminds me a little of older versions of Windows, or the desktop on my Raspberry Pi, which is also based on Debian. (I think the others are all Ubuntu based.) Lubuntu is the prettiest at first sight but I could live with any of them.

I had no problems with video drivers on my laptop. Everything is clear and sharp and works as you would expect. When I try the live usb systems in my desktop, which has a Radeon graphics card, I get slightly different results. SO… if you are thinking of using a usb live system to move between several machines, you will probably have to do some tinkering to get everything just the way you want it.

The sound is good on all the distros except Kanotix, which is a bit crackly. That may be because I haven’t spent enough time adjusting settings, but as my aim is to find a distro that needs minimum tweaking… I’m typing this on one machine while listening to Cream on headphones through You Tube running on Puppy on the other. Awesome!

Word Processing

If you are planning to do much typing, you will want a word processor on the computer.

PCLinuxOS, Lubuntu and Puppy Linux come with Abiword included. This seems fine on first trial, although if I was installing to the hard disc rather than running from the live usb I would definitely add Libre Office. Puppy has a menu item to download this. Kanotix and Porteus only come with the Leafpad text editor. (I could have sworn I asked for Porteus to include Libre Office. Either I clicked the wrong button, or the build didn’t work.)

Alternatively, you could use something like Onedrive, which gives you MS Word on the Cloud. I occasionally do this if I want to share a document between my iPad and another computer, and it works very well. (Other Cloud options are available!)

Internet Connection

All five distros work perfectly with the internet if you are plugged into your router.

Only Puppy and Porteus give simple access to our wireless network at home – select service, then enter password. The other three distros require you to set up the router connection from scratch. This is not hard, if you haven’t lost all the information that came when you bought the router, but I wouldn’t want to do it every time I logged in.

I used the ‘save settings’ option when shutting down Puppy, and after this could connect wirelessly without entering the password again. I’m sure the same would be true if I made any of the other distros persistent after setting up wireless connectivity. (See below for more on persistence).

None of the distros activates a firewall automatically, but it’s pretty easy to do once you find where it is hiding. On line help is a wonderful thing! After I saved my settings, Puppy started the firewall on the next boot.

Web Browser

Lubuntu and PCLinuxOS come with Firefox. Kanotix has Iceweasel, which is very similar. When I created the Porteus .iso file, I requested Firefox (Chrome and Opera are also available as defaults). You can, of course, add any other browser you like once the system is loaded.

Puppy does things differently, providing the lightweight browser Dillo by default and offering a choice of Firefox, Seamonkey, Chromium and Opera via the Quickpets package manager on the desktop. This is a simplified package manager that gives access to the packages you are most likely to need at the outset. As Dillo did not work straight away, I went mad, installed all four bigger browsers and spent a happy hour playing with them. They only take a couple of minutes each to install, so it would be no great hassle to download one every time, but in the end I restarted and loaded Chromium before saving my settings. If you are running Puppy on a very old machine, you might need Dillo but you will have to spend some time setting it up. It works well enough on my Raspberry Pi.

I watch music videos quite a lot, and get pretty fed up with the Flash plug-in message. All the systems here played You Tube videos without requiring any tweaking. (Lubuntu and Kanotix requested the plug-in, then worked anyway without me doing anything.)

NOTE If you are doing serious work on your system and saving stuff, you will want to make sure your browser has the latest version of Flash (which I think means using Chrome or installing the Flash plug-in to Chromium) to avoid security vulnerabilities. Alternatively, only play video that doesn’t require Flash or install a ‘video without Flash’ add-on to Firefox. Having said that, running from a live usb means that everything gets lost at shutdown (as long as it’s NOT persistent!) so you don’t really need to worry too much.

Internet history is saved in Puppy once ‘save settings’ has been turned on. If you don’t want this, you can configure the browser not to keep history in the usual way

Customization

My aim was to find a distro that ran from a live usb on my laptop with the bare minimum of adaptation, so I haven’t spent any time finding exciting software and adding it. However, here are some observations:

  • Puppy makes it very easy to find the things you might want to add at the start via Quickpet, and it’s so small that you can try various options quickly, then reboot to get rid of them. There is also a Setup menu option which takes you to a list of wizards for customizing the sound card, printers and so on. I didn’t need this, as the tasks I absolutely had to do were prompted when I first loaded Puppy.

  • Porteus requires you to log in as root for most system related work. The password is ‘toor’.

  • ALL Linux systems are almost infinitely customizable (I think that’s a word…), so whatever you start with you can create the system of your dreams. At least in theory.

  • Bear in mind that if you really want to customize your system, you will have to make it persistent or install it to your hard drive.

Persistence

Persistence preserves your settings (including firewall), internet connection details and internet history. I was also able to save files to the usb or the hard drive, and I don’t think persistence affects those one way or the other.

I made Puppy persistent as an experiment, but I’m unsure whether I would bother with a persistent live usb otherwise. The idea that you can transfer your system and settings to any machine is great. Unfortunately, once I had saved my Puppy settings on the laptop the system didn’t work as well on my desktop as it had the first time round. (Something happened to make the screen very dark). And I have a nasty feeling that correcting this could easily have resulted in those settings being saved, giving me a problem the next time I boot the laptop into Puppy. So it’s probably best NOT to make your live usb system persistent unless you only ever intend to use it on one model of machine.

Ask yourself why you might want persistence. If it’s because you have to have your system just so all the time, then you might be better off with a permanent installation. The great advantage of a Linux live disc or usb is that you can use it as a starting point on any machine, quickly add the packages you need to get running, do what you need to and move on. I imagine tech support people have dozens of distros in almost every version possible, and know from experience exactly what to use where. They may want persistence now and again, and they are expert enough not to screw things up. I’m not sure I trust myself that much!

Finally, saving settings takes time. Non-persistent live Linux systems shut down in a few seconds as nothing is being saved. Puppy Linux with ‘save settings’ takes a minute or two.

Conclusion

As you have probably gathered, I’m very impressed with Puppy Linux, and it will be my distro of choice when using the laptop on the internet. I’ve made it persistent, but I can live with that. When Vista finally turns up its toes or I don’t want it any more, I will install some form of Linux on the machine and it might well be Puppy.

A very strong second choice would be Porteus. Fast, good looking and detected our wireless router straight away. I like the way you can choose features before creating your .iso file.

If you’ve got this far, you are probably considering trying Linux on an old laptop. Any of the five distros I have discussed would be a good starting point. Try them on a live stick – and if you don’t like them, download something else instead.  Good luck!