Bog Roll ::

It's Not Magic, It's Work!

31 Aug 2020

Physical to Virtual

After upgrading my Dell laptop from HDD to SDD I had a perfect image of the laptop on an unused HDD. I thought I'd have a go at converting it from a physical system to a virtual one.

Using the SATA-USB cable I hooked it up to my desktop system, it appeared as /dev/sdc on my desktop system. If you have a USB3 or SATA connector that will be a lot faster than the USB2 I had to use.

First you need to know how big your disk is in bytes, so for that I used:
sudo fdisk -l /dev/sdc

Next you read the image from the disk to a file. You obviously need at least as much free disk space as the image, I used:
sudo cat /dev/sdc | VBoxManage convertfromraw stdin image.vdi 160041885696
where sdc is where the dive was added, image.vdi was the image I wanted to create and 160041885696 was the disk size that fdisk returned. Once that started go for a cup of tea or two...

Next up is the bit that requires luck. In Virtualbox I created a new system, and tried to match it as close as I could to the underlying physical system it came from. When you boot the system Windows could blue screen or the Linux initramfs may be missing essential drivers, and you could be stuck. In my case, both booted fine with the settings I'd given it.

Next I wanted to reallocate the disk space. So on the Linux image I de-installed all the GUI components, leaving only a small CLI system, then using an image of GParted Live I shrank the Linux system from ~110 GB down to ~15 GB and expanded Windows from ~40 GB to ~135 GB. At this point the virtual disk image was quite fragmented and not very optimal.

I booted Windows up, deleted things I didn't need, de-fragged it and then downloaded and ran sdelete.exe from Sysinternals. That doesn't actually shrink the virtual image, but it does clean it up so that it can be compacted. I shut Windows down and then used Virtual Box to compress the image:
vboxmanage modifymedium --compact <image GUID>
You are supposed to be able to use the filename of the image file, but it didn't do anything so I used the image GUID which worked fine.

The result is now I have a fully functioning virtual Windows 10 system and a residual Linux (Debian 10) system inside a Virtual box. If I could be bothered I'd remove Linux from the image and return it to booting from the Windows boot loader instead of GRUB. The total disk size of the image on my desktop is now closer to 50 GB, which isn't too bad.

I don't run Window at home, but it's useful to have a copy lying around when some idiot company doesn't provide a way to do something with Linux and you are forced to use Windows to talk to a piece of hardware.


20 Aug 2020

Brexit III

Here we are hurtling towards a no-deal BREXIT. The only way to stave disaster in Ireland was to agree to a border between NI and the rest of the UK. To add insult to injury the whole of Kent will now be treated commercially as the EU to provide enough space for all the customs clearances that will be required.

Taking back control over our borders seems to mean losing the cooperation we had before, so now we have less control than we started with. For example from 1 Jan, refugees can't be deported back to the EU anymore, the UK will have to deal with them!

Getting rid of red tape, appears to mean thousands of new civil servants, and millions of new forms, so there will be more red tape than people could possibly imagine, though it now looks like the stronger green laws, will actually be weaker food standard and environmental protection so that the US can export their vast and highly suspicious agricultural surpluses to the UK, wiping out British farming.

The easiest trade deals in history have turned into one utter farce after another one, and so far the UK has made deals for only 10% of the UK's global trade so come 1 January the UK will be trading from a worse position than before for 90% of the foreign trade. While the EU has improved it's trading position by more than the total value that the UK contributed in trade to the EU totals.

Foreign companies have pretty much said in the event of no deal, then they will up sticks and move most or all of their operations to the EU, and so far that seems to be mostly happening, bye-bye British motor industry. This seems to be already happening, and is expected to accelerate.

So far it's safe to say everything that the remain side said would happen, is happening, and everything the leavers promised has turned out to be a lie. Hardy surprising really, reality is what it is... If Trump goes down in November then things will look a lot worse for the Brexiters than they do now.

I don't like being this right, with something as important as this, but I (and many others) did say this at the begining... Brexit II


16 Aug 2020

SSD

Yesterday I cloned the HDD of an old Dell laptop to a new SSD with Clonezilla, then using GParted Live expanded the file systems to fill the disk.

Once that was done, I let the Windows system spend most of the afternoon upgrading, as I don't boot it often so it was rather out of date. In the process it installed lots of crap that managed to fill up all the space I'd created for it. After the upgrade and several reboots, I deinstalled all the extra crap it had added, but it now works and is running the current release of Windows 10.

The Debian system, which I use 99% of the time, wasn't happy to boot, so using GParted again, I booted up, and used a chroot to regenerate the initramfs and then updated GRUB, and on reboot it was fine.

So far that machine has had over the years:

  • A brand new Dell battery to replace the dead original one
  • A RAM upgrade from 4 GiB to 8 GiB
  • Windows 7 to Windows 10 upgrade - when MS were giving it away
  • Linux installation, and made default
  • 160 GB WD Scorpio Black HDD to 500 Gb Crucial MX500 SDD upgrade

Having done the HDD-to-SDD upgrade I don't know it feels any faster, but boot time is noticable faster.