Tuesday 17 February 2015

Accessing Linux On Windows

Running portable applications is nothing new. Linux has been available, in one form or another since the first Live CD (Yggdrasil Linux) was released back in 1992. And since then the Linux Live CD has gone from strength to strength.

But alas (or "thank goodness for that" depending on how you look at it) the Live CD is no more. It still exists but the ISO images are so big it is either burned to a DVD or a USB drive.

USB drives have revolutionised the way a Linux Live CD distribution works. Thanks to the 'persistence' option in some of Live CD distributions you can now update the live distribution, add more programs, keep your various settings, and save files to the same USB drive that you boot from.

I have about 4 USB drives which have various live distributions on them. And they have all worked like a charm; except one which was hardware failure rather than anything to do with the the live distribution.

When having overnight stops at friends I no longer need to take a laptop. I just plug in the USB drive, reboot the computer, and 99% of the time away it goes and all my settings are there, all my files are there, and it is just like working on my laptop without actually working on my laptop. So far, from personal experience the only problems I have had is when using computers with USB wifi. Anything with an Ethernet connection has always just worked.

The other day, however, I went to use my sister's computer. I was about to plug in my USB drive and boot into Linux when I heard a whining noise behind me. It was my sister who was complaining about the risks of a USB drive having viruses. I explained it was virus free but she insisted that it be scanned before booting from it.

The first problem was Windows 7 didn't recognise the US drive purely because it was formatted in the ext4 format. The second problem, entirely linked to the first, AVG couldn't scan a drive that Windows didn't recognise. It could be easily solved by installing the drivers necessary for Windows to recognise the various Linux drive formats, which in the past has always been solved by the excellent Ext2Fsd (Ext2 File System Driver for Windows) which supports Ext2/3/4. But the problem there is that it needs installing; which when you are merely using a machine for a hour or so seems like too much hassle - download the program, install the program, copy a few files across, uninstall the program, and finally clean the Windows registry.

Ext2explore - Main Screen

Enter Ext2explore. No need to install and no registry entries. Download the zip file (3.5MB) extract the executable and run. My Ext4 format USB drive was accessible. Admittedly Windows still couldn't scan it, and I still couldn't run my own desktop, but at least I could get to my own files.

Now, the chances of the same situation arising again, except at my sister's house, are pretty slim. But to be on the safe side I thought I'd drop Ext2explore on another USB drive just in case. But it got me thinking. Why isn't there a Windows Live CD? Well there is. OK. Sort of there is. You can create one using BartPE which lets you create a Windows Live CD.

For me that wasn't much use. If I could just boot off a CD or USB I'd just use Linux. If I had to use Windows I just needed access to my files which were on an Ext4 USB drive. And to me hat just meant I would need to run Ext2explore from one USB and read my files my regular USB. But that meant 2 USB drives in the same machine.

There had to be a better way. And the solution I came up with may not be the ideal solution but it works for me.

Booting into my regular Linux desktop, on my laptop, I used GParted to resize my main Ext4 partition (I shrunk it by 256MB and moved it to the right) I then created a 256MB Fat32 partition at the front of the drive. Windows will only recognise the first partition on a USB drive by default so that is why it was created at the front.

Then I installed Grub2 on the USB drive; then the only change was to set the time out of the Grub2 menu to 5 seconds. In theory 0 seconds could be used to avoid a delay but if anything ever goes wrong it is nice to have a little bit of time to see what is going on with Grub.

Bingo! Everything worked (after a few minor modifications). Plug the USB drve in when Windows is running and I can get to Ext2explore. Plug the USB drive and boot from it and it ends up on my Linux Ubuntu desktop.

PortableApps Menu - Activated by the icon in the System Tray

That is all that is needed. But I went one step further. Using yet another USB drive I installed the PortableApps menu system on to it. I then copied the files created to the Fat32 partition of my Linux USB drive. I then installed a few portable applications (also from PortableApps).

Finally I left it alone. But now I can boot Linux, and if I have to use a Windows machine I have the PortableApps menu and a few tools and utilities at hand also. The one, and possibly the main, advantage is that using Ext2explore I can take files from the Linux partition, work on them and transfer them back to the Linux partition in Windows.

That is where I stopped. But it should be possible to have all the files that I need to edit on a regular basis stored in the Fat32 partition. And just access them from both Windows and Linux and leave them in one place. It should be just a matter of resizing partitions (I knew I should have made the Fat32 partition bigger). Copy all the files to a folder on the Fat32 partition (PortableApps does create a folder called "Documents") and then they are available at all times.

No comments:

Post a Comment

Thank you for your comment. Please note that all comments are not moderated and as such are not the responsibility of this blog; or its author.