A virus has corrupted my desktop's hard drive. How can I remove the remnants of Windows and install Ubuntu on it?
I have only a working mobile phone and one 4GB USB drive. The 4GB drive has vacation photos on it. I have no friends to borrow things from. What to do? Step by step please, any terminal commands should be familiar to a Ubuntu user.
This question is loosely based on Is extracting a ISO file to USB the same method as creating a bootable USB? which was deemed off topic by the DPP.
Yes, it's possible
Using only an Android phone with internet, root and a USB Cable, you can emulate a flash drive with your Android phone using an app called DriveDroid. However, this is not officially supported and you may be better off asking a local Linux enthusiast (or anyone else who has a working computer) to burn a LiveCD for you.
If you still want to use DriveDroid though, here is a tutorial:
The app DriveDroid is available on Google Play with searching or this link: https://play.google.com/store/apps/details?id=com.softwarebakery.drivedroid
*There are a bunch of methods you could use to resolve your issue. You just have to be creative and resourceful enough to pull it off. You also have to do your research. There are plenty of online resources (tutorials) that can walk you through each process. You'll have to know your Linux stuff to get through the rest.
To view your mount points, mount paths, and partitions... Android handles this differently because it doesn't use a GNU OS. It uses a proprietary OS called Android. Google uses the Linux kernel as the base of the OS, but it won't function the way a normal GNU/Linux OS will typically function.*
Your most common operations for listing device information is:
I highly suggest reading some type of book on
bash
which is the most commonly used TTY aside fromksh
andsh
. The Linux Documentation Project website can help you out there. This takes some time though and won't immediately help you.The Unobtrusive Method
If you have a working Ubuntu partition on your machine, boot into Ubuntu, and unmount any partitions related to Windows.
Using
lsblk
andmount
can help to determine the drives and partition tables.Delete those partitions and then create a new filesystem (ext4 is probably a good choice).
Windows is now gone and you have a Linux partition available to you where Windows once was.
/
,/boot/efi
, and[SWAP]
are all Linux partitions. Which means that sda1, sda3, and sda4 are my Windows partitions. I can use GParted (a Linux GUI for GNU parted) to modify and edit any required partitions.Grub will still boot and you'll have to edit the EFI table so that only Linux shows up instead of looking for a missing Windows Boot Loader. I'm sure there are articles on Ask Ubuntu and the Arch Linux Wiki that explain this in greater detail.
The Hacker Method
You're most likely better off going to your local electronics store (or library), downloading the ISO, and
dd
it to your USB drive from there. You can create a local running instance of the applications you need so that they execute directly from the USB.The employees won't understand what you're doing, so don't bother asking them for assistance. Most of the time, I just start doing what I need to do and nobody bothers me or even looks twice. I've actually taught a few employees basic things like how to access
msconfig
and how to tell what components are inside of the machine.Worst case scenario, they can ask you to leave since you're not actually breaking any laws by doing this. If you feel uncomfortable, go as far as asking for permission (never hurts to ask and the worst they can do is say no).
The DIY Method
Assuming you want to MacGyver the hell out of this, the only method I can think of would require an Android phone with a minimum of Android Lollipop OS (5.0), and which is USB OTG compatible (not all mobile devices are).
From there, you can download the Termux app from the Play Store. Once it's downloaded and installed, you can run
termux-setup-storage
will create a storage directory in your termux home path that will allow you to access your internal SD storage without root access. (Typically, you would need to be root to access anything outside of termux from within the termux environ. The OS apps are typically encapsulated by design.)Then install anything you need from there to get the job done. This is a rootless app (meaning you do not need to be root).
Download the ISO. Follow the steps you would normally follow and wait. It will take your little mobile device some time. Quite a bit of time actually. It depends on the MicroSD read/write speed.
The Local Method
There is one last method I cant forget to mention and that's Linux Deploy. This is a tricky app to configure and use if you have zero experience with it.
Once it's installed, you can use an app like JuiceSSH for a headless session. If you have a device that's capable of running a GUI, you can always activate it and use it using VNC Viewer.
Linux Deploy, JuiceSSH, and VNC Viewer can be used to locally connect to your running instance. I usually install something lightweight like XFCE, LXDE, or the like. There are enough GUI's to choose from to get what you might like. People typically prefer this setup because it gives them the ability to use Kali Linux OTG.
What's great about this is that any Android version over 2.2.x (I believe, feel free to correct me if I'm wrong) is capable of doing this. It can be very slow on older devices (speaking from experience).
From there, once youre logged in, you can do a lsblk, you should see your USB OTG drive pop up as a /dev/sda device and you can do your thing. This has access to your local partitions and what not as well as having access to all of your normal GNU applications instead of solely relying on busybox, Terminal Emulator, or Termux.
To ssh in to your local install, your address will be
localhost:5900
.Making a bootable USB
You can use
lsblk
and if not, usedf -h
to list the loaded mount points with human readable output.If you don't know how to make a bootable USB via the command line, there are some great posts here on Ask Ubuntu. This is my favorite go to:
Source