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

Calculators for the 2017 A level syllabus

Students starting A level maths from September 2017 will study both mechanics and statistics. The exam boards now require candidates to have a calculator that ‘gives access to’ certain probability distributions. In other words, statistical tables may not be enough to answer all questions completely. For example, the WJEC sample Unit 2 includes a question on the binomial distribution where n = 60, a value not found in most (any?) sets of tables.

This change means that it will no longer be possible for students to carry on using their GCSE calculators for the whole of A level. Schools will undoubtedly recommend a replacement, and may well organise a bulk purchase scheme, but here are my thoughts in case you want to go it alone.

Graphical calculators

All the Casio graphical calculators include a wide range of probability distributions. I have an fx-9750GII (inherited from a former pupil whose school made them all buy one as an alternative to tables), and it’s a great machine. I use it for stats, matrices and complex numbers…. But never for graphs!

The truth is that unless you buy a high end graphical calculator, graphs will always look better on a computer. I use Graph (http://www.padowan.dk/) which runs on any Windows device including tablets (and on Linux under Wine), or Desmos (https://www.desmos.com/calculator) which runs in a web browser, and even on a smart phone.

Graphical calculators are heavier and bulkier than standard scientific calculators. I never take my graphical calculator out of the house. They are also much more expensive. An fx-9750GII will cost between £50 and £80, and the ‘natural display’ fx-9860GII about £30 more. School students will want the fx-9860GII simply because it displays fractions as fractions (and they would be right!), so you could well be looking at £100 for a calculator. Ouch!

Scientific calculators with probability distributions

The Casio fx-991EX is a new model which does just enough for the new syllabus. It seems to be a successor to the fx-991ES (see below), and will be suitable for further maths A level as well. It has good reviews and is widely available, and I think it is likely to be the model recommended by most schools. It costs about £25 to £30. Just make sure you get an English language version!

The TI36X-PRO is Texas Instruments’ equivalent to the fx-991EX. It does much the same things and retails at about the same price, though your are less likely to find it in the shops in the UK. Be warned that TI calculators do not work in quite the same way as Casio models. Some people like this, others don’t – but either way, if you are used to a Casio then a TI36X is going to feel a bit strange to begin with.

Thirdly, if you are travelling to the States, the Canon F-792SGA sounds like it could be a worthy rival to the two machines mentioned above. Unfortunately, it doesn’t seem to be available in the UK.

The Casio fx-991ES PLUS

This has been widely used by A level further maths students for several years, mainly because it handles complex numbers and matrices sufficiently well (but not as well as the graphical fx-9750GII). It also performs numerical integration – very handing for checking! It is my everyday pencil case calculator, familiar enough to lend to  GCSE students, powerful enough for almost all situations I am likely to encounter. And you can buy it for £15 to £20, so it’s not much pricier than a basic GCSE model. (I’m hoping that with the advent of the fx-991EX this one will be discounted, so I can pick up a bargain to keep as a spare!)

If you are about to buy a calculator for A level, you would be wise to go for the fx-911EX unless you really can’t afford the extra tenner. However, if you already have an fx-911ES (perhaps from an older sibling), then you can keep it for the new syllabus by using the sum and integral functions. This is what I plan to do, at least for the time being.

The rest of this post is a bit technical, and assumes you know what the probability distributions are and how they work, so if you are just starting A level it won’t make much sense. But if you are familiar with the binomial distribution and its friends, read on…

Finding cumulative probabilities with the fx-991ES

For these comparisons I used the WJEC statistical tables, the appropriate function on the Casio fx-9750 and the sum or integral described on the fx-991ES. For completeness, I have included integration as a way of dealing with the normal distribution, even though students will find it easier to standardize their distribution and use z tables in the usual manner.

a) Binomial distribution X~ B(20, 0.1)

  • Test:    P(X ≤ 7)
  • Tables     0.9996
  • fx-9750    0.99958436
  • fx-991ES   Using    Selection_001

                 p = 0.999584365

The binomial coefficient is entered using the nCr button (shift then divide).

b) Poisson distribution X~ Po(9.5)

  • Test:   P(X ≤ 8)
  • Tables    0.3918
  • fx-9750   0.39182348
  • fx-991ES   Using

Selection_002

                                         p = 0.3918234825

This is easiest using natural fractions display inside the sum function.

c) Normal distribution X~ N(10, 22)

  • Test:   P(X < 12)
  • Tables      Using P(Z < 1) = 0.84134
  • fx-9750     0.84134445

(calculator shows z limits of 1 and -5, i.e. 5 s.d. below the mean)

 

  •  fx-991ES   Using

Selection_003                      p = 0.8413444594

(Lower limit is 5 s.d. below mean).

 

Comment

As students will be expected to find single value probabilities by calculation for the discrete distributions, it is only a small step to learn how to sum these into cumulative values. The integral for cumulative normal probabilities is a bit of a pain to type and tables will always give a good approximation. However, these calculator methods do give a quick(ish) way of finding the probability that X lies between two values (e.g. P(2 < x < 15) ), which would otherwise require finding two probabilities and subtracting.