Linux Tips
Rescuing Client Data
2020.03.23
Nathan Thompson
I DO NOT MISS WINDOWS XP IN THE SLIGHTEST! Wait, is this another old man yelling at clouds moment? No, not exactly anyway. Instead, it is a simple declaration of never wanting to deal with Windows XP again.
Reminiscence
I was never a big XP user. (Un)Fortunately, many, many, many clients used XP, thus my main experience with the system and Windows in general. With Microsoft struggling to get the next version of Windows out the door{1}, and the tepid response of the long gestating replacement{2}, XP stuck around for a good decade{3}, dominating the personal computing landscape (many embedded devices as well).
One of the biggest issues I had with the system, it just seemed like Windows XP would run pretty well, but as software was installed and uninstalled and especially with system patches, everything just kind of slowed down over time. XP had system patches which rolled up all the subsequent updates into a big update{4}, but only received three total in its lifespan, which meant, there were still quite a bit of patches that hit after SP3 was released{5}, or even the time period between the big SP releases.
While I did my utmost to avoid XP, it was a fixture of the industry, as such… wait…say what now? Pardon your interruption, buster! I do not appreciate your accusations! Yes, yes, full disclosure, I was briefly tasked with having an XP computer for work. Fine, hope you are happy now! Well then! To continue this digression, by bragging a wee bit, my XP system ran flawlessly for me, but that was because I demanded a secondary account as a standard user. The second big issue for me with Windows XP was not wanting to use an admin user for day to day operations, since XP simply gave far too much power to the default user settings. Seriously, out of the box, users were essentially root, if I may use parlance for any readers more familiar with Linux and related systems.
Also, I tended to use a secondary, non Internet Explorer web browser such as Opera (classic Presto version thank you!) or Firefox in an attempt to mitigate attack vectors. I did not use XP much longer than, perhaps…six months… maybe, subsequently swapping back to my Linux and Mac OS systems.
{1} Longhorn was delayed and then later canceled.
{2} From the ashes of Longhorn, begat Vista.
{3} At least! General release hit 2001.10.25, mainstream support ending 2009.04.14, but extended support running all the way to 2014.04.08! Not to mention the three security patches released past that date.
{4} Well, Wikipedia states SP2, first required SP1, but SP3 contained all of SP2's updates, not that I remember at this point.
{5} 2008.04.21 left quite a bit of time for patches upon patches to apply to the often creaky XP base.
Today's Challenge
Tale of two Windows Systems
Well, I have a client, and she has two computers, one running Windows 8.1 and one still on XP. The former was a piece of cake to get upgraded to Windows 10{6}:
- Backup data.
- Honestly, the system had one user account and only contained a little date in the usual directories, a straight transfer of the user folder to an external USB drive sufficed.
- Reset to factory settings.
- Make backup restore drive for Windows 8.{7}
- Use a Windows 10 install drive to upgrade to Windows 10.
- Make sure system activates with a digital license.
- Boot back into Windows 10 install drive and perform clean installation.
{6} Just a condensed overview, sorry for those hoping for one of my ridiculously lengthy explanations.
{7} Yes, Windows 8! Apparently, this system was originally on 8, not 8.1, so a restore brings the system back to 8.
First questions and answers time!
~
Why did I not simply make the backup install media from the original 8.1 installation?
Well, the system was running a little slow originally and I wanted to make sure the hardware was still working properly and factory reset to the original installation in step 2 helped me rule out any problems with the drive before continuing.
Why did I not perform a clean installation to Windows 10 originally and skip the step 4 upgrade install?
I am a little paranoid about Windows 10 activating properly from a clean installation (remember, we are technically out of range for free Windows 10 upgrades), so I always upgrade install, activate, and then clean install. I admit to this being quite possibly, wholly unnecessary.
Why did I not simply skip the clean installation of Windows 10 in step 6?
Arguably I could have skipped the Windows 10 clean installation, but I prefer to start from scratch. Likewise, very likely a wholly unnecessary step and is mostly a philosophical thing. Your beliefs may differ.
~
Yes, I always overthink things, but the system is now running as well as a few years old, low end computer, with spinning platter can expect to run Windows 10 and frankly feels much better than the old 8.1 installation.
Where the heck is the Linux tip in all this Windows poppycock?
Yes, yes, a little bit of Linux knowledge is the goal for today. Without further ado, now let us take a look at that second client system. Very old, Pentium 4 desktop with 384MB RAM.
Second questions and answers time!
~
Why not upgrade the RAM?
I did not have any of the appropriate RAM and scavenging for memory modules online, even if essentially free, would still leave me billing for an upgraded, but probably still not Windows 10 capable desktop, stuck on Windows XP.
Total dead end?
Well readers, at first I considered trying a low resource Linux system, but decided maybe it was better to only expend effort on a replacement system. Given the dearth of RAM and preference for a few Windows specific apps.
"Does the replacement system run Linux?"
Uh, well, no, Windows 10 on this one too.
~
Bear with me now, we need Linux to rescue the data off the internal drive of the XP desktop. The XP system was running so slowly, in all seriousness, perhaps 30 minutes to boot. Then the bugs of the current install and possible malware infection would kick in and the system was often still completely non usable. With an older system like this, USB booting should still work, but I decided to make a USB boot drive and a bootable CD. I was pretty sure this particularly Pentium 4 was not 64-bit, so our requirements were as such:
- A 32-bit Linux.
- One which ran in 384MB of RAM.
- Small enough to fit on a CD.
Many Linux distros are no longer 32-bit, nor small enough to fit on a CD, and some do not run particularly well on low RAM either. Luckily, SystemRescueCD fit all three requirements.
I hear your vocal utterances already:
"But why Nathan could you not simply pull the drive, connect it to the presumably properly configured, replacement Windows 10 system, run your Windows Defender scan on the data, and then just transfer it over?"
PATA my friends, parallel ATA, aka IDE, I simply no longer own a system, nor adapter that will interface with such a drive. My last adapter died a few years backs (several now?) and I have not encountered any PATA drives in the wild since then. Well, until now…
SystemRescueCD Data Transfer
Finally, the good stuff. Just how are we going to transfer the data over?
- Boot SystemRescueCD (USB boot worked fine, but I was glad to have the CD just in case).
- SystemRescueCD is now Arch based, but the same basic workflow applies as the older Gentoo based distro.
- When you first boot the system, there is no GUI, just tty1 with simple instructions for how to set your keyboard layout with setkmap and how to start the XFCE powered graphical environment with startx in order to access such tools as GParted, Firefox or FeatherPad (text editor).
- Since we may want to use GParted to make formatting our backup data drive easier, let us type startx to get into XFCE
- Use GParted to format backup drive.
- Right click on the appropriate unformatted drive in GParted and select New.
- Under File system: we want to select NTFS for the partition type.
- Create mount point for your drive
- First the internal drive.
mkdir /mnt/WindowsBoot
- Now the backup drive.
mkdir /mnt/WindowsBackup
- First the internal drive.
- Mount our internal NTFS Windows boot drive in read only mode
mount -t ntfs /dev/xxx /mnt/WindowsBoot -o ro
mount
is a command for mounting the drive;-t
tells the type, in our case,ntfs;
/dev/xxx
is the source drive (replacingxxx
with your own drive), in our case the defective Windows XP boot drive;/mnt/WindowsBoot
is the mount point;-o
gives us options; in our case,ro
, which means read only.- Look, perhaps we do not need to enforce read only mode, but seems safer since we are copying data from apparently the only source, given we are not just transferring from our pre-existing backup, am I right?
- Mount NTFS external drive.
ntfs-3g /dev/xxx /mnt/WindowsBackup
- Easy enough, similar to the last command but instead of the
mount
command with qualifiers and so on, read/write access is granted via thentfs-3g
command;/dev/xxx
is the source device;/mnt/WindowsBackup
is the mount location.
- Easy enough, similar to the last command but instead of the
- Copy data from NTFS internal boot drive to external data drive.
cp -R /mnt/WindowsBoot/Users/. /mnt/WindowsBackup/
- While there are many ways to copy data over, the easiest way is probably just to use
cp
in the terminal to copy the user(s) folder(s) over.-R
is recursive, as we need to grab all the folders and files in that directory. The.
just means copy the content of the Users directory into our destination instead of copying the overarching "Users" folder (E.g. User 1, User 2, User 3, Public, etc). No reason really, just a fun exercise in copying over contents versus folder itself./mnt/WindowsBackup/
is the destination directory for our backup data.
- While there are many ways to copy data over, the easiest way is probably just to use
- Shut down the faulty WIndows PC.
- Connect external drive to new Windows PC running Windows 10.
- Within File Explorer, right click on the backup drive and select Scan with Windows Defender… (feel free to subsitute with your own preferred anti-malware tool).
Step 10 could take a while, so honestly, at this point might be better to delete any unneeded data from the old drive and then run step 10 from there. Once done, copy needed data to the new computer.
Linux is a multi faceted tool
While Linux can be the foundation of a server OS, a desktop OS, or even an embedded project, in this case, it was simply a bootable rescue tool for a Windows system. Which is fantastic and the whole reason I adopted my computing use to include Linux. It can be all things to all people if prodded and pushed into the right shape. Hopefully this walk through might prove useful to anyone wanting to migrate data from an older Windows system to a newer system.
Happy computing!