Re-purpose a laptop

From regional-training

overview

Old laptops often make wonderful Linux workstations. Many people find their Windows laptops get slower and slower with age and want to buy a new one. If you have an opportunity to obtain an old laptop that is not too vintage, you may find it will run Linux much better than it ever ran Windows.

The first thing to do is to boot the laptop (or computer) with a live Linux image to see if it handles the device drivers for the WiFi and the display etc. My standard test is to launch YouTube and play a video and watch the performance using htop. If you can play video with it without buffering you have a really good laptop for Linux. [1]

If the live boot works (and particularly if it passes the YouTube test) then you have a decision to make: do you want it to be even faster?

If the answer is yes and you can afford it, look at installing a bigger SSD drive (see #replacing an HDD with an SSD):

This instructional outlines various steps you can take.

How to Clone

requirements

  • USB / SATA dongle for an external hard-drive, or USB external hard-drive
  • live image boot of
    • Debian, or
    • Kali, or
    • L/ubuntu

There are two ways:

  • boot from the live boot and copy onto another external drive
  • remove the hard-drive and plug it into USB / SATA adapter and copy to another external hard-drive using another computer.

I perform this type of task on a regular basis and go the removal route as I am typically replacing the drive with an SSD anyway. I Usually only need to wait a few days for the SSD to arrive in the post, so I first try running the OS on a spare drive while waiting. You can even cannibalise a HDD out of a USB external HDD case, and if you look inside one of those cases you will see it contains a USB drive adapter on a small PCB.

USB to HDD adapters can be purchased on ebay for minimal cost and I ow have over 7 in my office (because I misplaced a few a while back and bought some more). I also have quite a few USB external drives because I used them for manual backups before I setup my automatic backup regime where I now use a NAS.

backup

🚩 Danger: take care with the dd parameters or you could overwrite the wrong partitions and ruin a disk image.

Run dd to copy the drive e.g.

 dd if=/dev/<old-drive> bs=10M status=progress of=/dev/<new-drive> 

Or to a file image on another disk

 dd if=/dev/<old-drive> bs=10M status=progress of=/home/old-drive.img

Or via compression to save space:

 dd if=/dev/<old-drive> bs=10M status=progress | lz4 -c > /home/old-drive.img.lz4

You can also copy from one drive to another via dd

 dd if=/dev/<old-drive> bs=10M status=progress of=/dev/<new-drive>

restore

🚩 Danger: take care with the dd parameters or you could overwrite the wrong partitions and ruin a disk image.

  • for uncompressed drive image
dd if=/home/old-drive.img bs=10M status=progress of=/dev/<new-drive> 
  • for compressed drive image
lz4 -d /home/old-drive.img.lz4 > dd bs=10M status=progress of=/dev/<new-drive>

replacing an HDD with an SSD

Replacing a HDD with an SSD can bring new life to a laptop. It will start and stop and find programs much faster than it used to. Adding an SSD will make it perform more like a recent laptop.

If you want to preserve the operating system (e.g. Windows) then:

  • select an SSD that is larger than the HDD
  • copy the image of the HDD onto the SSD
  • then (on Linux live boot) run gparted or parted to move the Windows restore and utility partitions to the end of the SSD
  • extend the main OS (C:) partition to use the remainder of the SSD.
  • replace the HDD with the SSD and reboot the computer.

If you are unable to move or extend partitions the file system may be damaged, in which case you need to run windows

chkdsk \f C:

on the partition to fix it on next reboot. Then you should be able to extend it plugged into a Linux box or with a Linux live boot.

Of course if you just want to keep the old HDD in the drawer and run Linux on your new SSD, then you can skip the backup and just install the SSD drive into the laptop and boot up a live install or net boot image that you have on a USB stick. (I carry them around in my laptop back-pack all ready to go.)

Danger: dd is a dangerous low level command and can overwrite your disk partitions: make sure you identify the drives and set the command parameters correctly. lsblk is a useful command to determine the devices for your drives, as is the fdisk -l command.

See also Repurposing_computer_equipment.

notes

  1. The YouTube test is the standard test conducted by my grand-kids - if the device fails they reject it. Laptops that fail the YouTube test are still good as a serial terminals so you can store them for use in some project that may require a serial or USB port - lol

categories