PC Troubleshooting - Ubuntu LiveCD/USB

Discussion in 'Chit-Chat' started by wilfredlgf, Nov 29, 2010.

  1. wilfredlgf

    wilfredlgf Regular Member

    Joined:
    May 6, 2003
    Messages:
    2,583
    Likes Received:
    11
    Occupation:
    Security Engineer
    Location:
    Malaysia
    Here are a few scenarios when an Ubuntu LiveCD/USB can come in handy to help fix issues on the computer. I'm certain other distribution of Linux or tools would work as well but I will only touch on as I'm more familiar with it.

    Note that the following tips shown might help depending on the issue of the machine - it is by no means a miracle fix. All below assumes that they are not hardware errors in which nothing can help you but seek a replacement.

    Feel free to contribute to the thread as I am definitely not the smartest guy here to know everything. :)


    Getting an Ubuntu Live CD/USB

    Step 1: Download a free distro of Ubuntu.
    http://www.ubuntu.com/desktop/get-ubuntu/download
    The file image would take around 700MB of space, just enough to fit a CD.

    Step 2: Burn the CD or create a USB drive
    Use any CD writing software you are familiar with that can write ISO images to a CD.

    Step 3: Put it away until an emergency as per the bottom example rears its head.

    Booting into an Ubuntu LiveCD

    Step 1: Insert LiveCD into the CD/DVD drive.

    Step 2: Press whatever button that the POST screen asks you to during computer startup.

    Step 3: Choose the language and subsequently the option:

    Step 4: Let the OS load. (yes, you read that right : the OS).

    Step 5: When the two horizontal bars appear, your Live CD is now loaded and ready to assist in your troubleshooting.


    Creating a LiveUSB (if you don't have a CD drive)


    Step 1: Boot into the LiveUSB environment.

    Step 2: Plugin your USB drive.

    Step 3: Choose System > Administration > USB Startup Disk Creator

    Step 4: Choose the 'Disk' to write the image to.

    Example:

    /dev/sdb is the physical disk
    /dev/sdb1 is the first partition
    /dev/sdb2 is the second partition, etc

    Step 5: Click on Make Startup Disk, accept the warning - make sure you chose the correct partition.

    Step 6: Let the process run and at the end you will have a thumb drive that is as bootable as the CD, but reusable/eraseable should you want to use it for something else.
     
  2. wilfredlgf

    wilfredlgf Regular Member

    Joined:
    May 6, 2003
    Messages:
    2,583
    Likes Received:
    11
    Occupation:
    Security Engineer
    Location:
    Malaysia
    Corrupted Windows Installation

    Problem: Your Windows won't start, all your data is kept in the same partition and is inaccessible. You cannot do a reformat and reinstall of Windows without killing the data or jumbling up the original installation with recovery files from the manufacturer etc.

    Step1: Boot into a Live CD/USB.

    Step 2: Click on Places.
    You should see a list of devices in the second row of menu. One of the listed disk (21GB, 200GB.. etc) should be the partition that is of interest.

    Step 3: Clicking on it should mount the partition automatically. A window should now open showing you what is on the partition.

    Step 4: Plug in whatever external storage you have e.g external HDD and copy out whatever data you need.

    You can even burn them to a CD by using the functional Brasero application.
    Applications > CD/DVD Creator

    Step 5: Click on the Ubuntu word on the top right to Shutdown or Reboot.

    Step 6: Reformat and reinstall Windows with your data all saved.
     
  3. wilfredlgf

    wilfredlgf Regular Member

    Joined:
    May 6, 2003
    Messages:
    2,583
    Likes Received:
    11
    Occupation:
    Security Engineer
    Location:
    Malaysia
    Hard Disk Partitions

    Problem: Gaps appear in the middle of the partition after installation of the OS, there is too much unused space on the system partition, you want to allocate space elsewhere, want to move the partitions.

    Step 1: Boot into the LiveCD/USB environment.

    Step 2: Go to System > Administration. Choose:
    Gparted

    The application should show the partitions that exist on your hard disk. To view other disks if there are more than one, click on GParted > Devices.

    The device naming conventions are normally as such:

    /dev/sda = physical disk
    /dev/sda1 = first partition
    /dev/sda2 = second partition, etc
    /dev/sdb = second physical disk
    /dev/sdb1 = first partition on the second disk

    The partitions can be manipulated by resizing, reshrinking, format et al.

    Example:

    - To resize, right-click on /dev/sda1 (usually where Windows is installed) and choose Resize/Move. Key in or click and drag the graphical interface to the desired size.
    - To create a new partition, right click on the grey unallocated area and click on New. Define the size et al.

    Step 3: Click on the green tick button at the top to commit the changes.
    Let it process - large volume of existing data might require much longer time to complete.

    Step 4: Shutdown or Reboot to go back to the Windows OS.

    Note:

    Modern Windows uses primarily the NTFS file system.
    Thumbdrives and external hard disks (small) normally use fat32/fat16.
     
  4. wilfredlgf

    wilfredlgf Regular Member

    Joined:
    May 6, 2003
    Messages:
    2,583
    Likes Received:
    11
    Occupation:
    Security Engineer
    Location:
    Malaysia
    Using the Internet without installing an OS

    Problem: At a cybercafe, awaiting parts (esp hard disk), not wanting to install an OS

    Step 1: Boot into a Ubuntu LiveCD/USB session.

    Step 2: Locate the NetworkManager applet.

    Depending on the version of the distro, the appearance may vary but their locations are the same at the top right corner of the screen. On 10.10 the icon are two arrows Up & Down (connected) or a broadcast icon with an exclamation mark (disconnected/unplugged).

    Step 3: Key in the required information

    For those with Automated connections available (DHCP), the machine should already be connected.

    For those requiring manual IP addresses, right-click on the NetworkManager applet and choose 'Edit Connections'. Click on Add to create a connection parameter on the IPv4 Settings tab. Choose the drop-down menu item Manual. Click Add to key in the desired settings. Press Apply to commit.

    The connection profile should now appear as a drop down item when you click on the NetworkManager. Uncheck the 'Connect automatically' checkbox if it does not show up in the list of available connection profiles. Choose the profile you just created.

    Step 4: Use the Internet.

    Notes:
    - Only Mozilla Firefox comes standard with the Ubuntu Live CD/USB distribution; you can choose to install others via the depository. WARNING: any files downloaded to this session of Ubuntu will be lost upon reboot or shutdown
    - the MSN compatible IM client that comes with 10.10 is Empathy IM
    - the BiTorrent client that comes with 10.10 is Transmission. WARNING: any files downloaded to this session of Ubuntu will be lost upon reboot or shutdown
    - the email client that comes with 10.10 is Evolution. WARNING: any email downloaded to this session of Ubuntu will be lost upon reboot or shutdown
     
  5. wilfredlgf

    wilfredlgf Regular Member

    Joined:
    May 6, 2003
    Messages:
    2,583
    Likes Received:
    11
    Occupation:
    Security Engineer
    Location:
    Malaysia
    Resetting Windows password

    Problem : Lost Administrator or admin-level password, cannot login to Windows.

    A modified post from How to: reset your Windows password using Ubuntu

    To reset your Windows password is very easy, as easy as resetting your Ubuntu password. What you need is bootable Ubuntu system (ie. USB, CD or anything) and software called chntpw.

    This is step-by-step to reset your Windows password:

    Step 1: Boot from your bootable device (Ubuntu Live Session)

    Step 2: Set your repository

    Goto Synaptic Package Manager -> Settings -> Repositories -> Ubuntu Software and check the “Software restricted by copyright or legal issues” checkbox. Click Reload when prompted.

    Note: Internet connection is required. Refer to Using the Internet without installing an OS.

    Step 3: Install CHNTPW

    Open the user Shell Application > Accessories > Terminal
    Install from Synaptic Package Manager or use this command on shell:

    sudo apt-get install chntpw

    Step 4: Resetting Windows password

    Mount your “Windows installed” device

    It’s depending on your system, example:

    sudo mkdir /media/WINDOWS
    sudo mount /dev/sda1 /media/WINDOWS

    Note: This might work by just clicking the drive first to let the OS mount it automatically.

    On my system Windows installed on /dev/sda1 and I want to mount it to /media/WINDOWS that I’ve created before. Goto your Windows system configuration folder

    cd /media/WINDOWS/WINDOWS/system32/config/

    Step 5: Cracking the SAM file

    There a SAM file on Windows system configuration folder. That’s the file we’re looking for. Let’s crack it.

    chntpw SAM

    And if you see the output similar with image below, it’s mean you can crack the SAM file.

    As you see, there is 5 choices. Just type “1″ and press “ENTER” to reset your password.

    Step 6: Shutdown or reboot.
     
    #5 wilfredlgf, Nov 29, 2010
    Last edited: Nov 29, 2010
  6. wilfredlgf

    wilfredlgf Regular Member

    Joined:
    May 6, 2003
    Messages:
    2,583
    Likes Received:
    11
    Occupation:
    Security Engineer
    Location:
    Malaysia
  7. wilfredlgf

    wilfredlgf Regular Member

    Joined:
    May 6, 2003
    Messages:
    2,583
    Likes Received:
    11
    Occupation:
    Security Engineer
    Location:
    Malaysia
    Securely erase hard disk

    Problem: Manufacturer or dealer wants hard disk back for warranty claims and the hard disk used to hold a big amount of data, some confidential or personal, the hard disk is still usable, computer to be auctioned or donated.

    Step 1: Boot into the Live CD session.


    Step 2: Open up the Terminal by choosing Applications > Accessories > Terminal.


    Step 2: Verify which hard disk you are looking to write onto by running the command

    df -h

    The output will show the storage that are detected by the system.

    (We will assume that the hard disk is hda)


    Step 3: Run the following command (assuming hard disk is hda, replace as needed)

    dd if=/dev/zero of=/dev/hda

    This will fill the entire hard disk with zeros. The process will take a long time depending on how big the drive is*.


    Step 4: For the paranoid, you can also fill it with random values.

    dd if=/dev/random of=/dev/hda


    Step 5: Repeat the above as many times as you like.



    *To see the progress of dd

    Step 1: Open up another Terminal.

    Step 2: Find out the process ID of the running 'dd'

    pgrep -l '^dd$'

    The output would look something like this:

    8789 dd

    Step 3: Send a USR1 kill signal to the process

    kill -USR1 8789

    Step 4: The current statistics should now be shown. To cause it to update at an interval:

    watch -n 10 kill -USR1 8789


    The end result is a jumbled up hard disk with data that is hard to rebuild, so all your po- ... data is now gone.
     
  8. wilfredlgf

    wilfredlgf Regular Member

    Joined:
    May 6, 2003
    Messages:
    2,583
    Likes Received:
    11
    Occupation:
    Security Engineer
    Location:
    Malaysia
    Hiding a Clone / Recovery partition

    Problem : Drive appears with letter in My Computer, messing up the sequence.

    Step 1: Boot onto the Live CD/USB session.

    Step 2: Resize/create a partition in EXT2 (3 & 4 is unnecessary for inactive partitions)

    Step 3: Reboot or shutdown.

    Step 4: Grab the Clonezilla tool
    http://clonezilla.org/

    Step 5: Burn the ISO onto a CD

    Step 6: Boot onto the Clonezilla LiveCD. Follow the steps to create an image of the partition you want to clone.

    Step 7: Choose the newly created partition as the destination.

    Step 8: Reboot or shutdown to complete.

    Step 9 (optional): Redo step 2 to shrink the unused space and reclaim it from the partition created.

    To recover, follow step 4/5 - 6, choose to recover from the EXT2 partition you created.

    The recovery partition is now 'hidden' from Windows and will no longer appear on My Computer. This can be useful for companies who make their own recovery partitions that are constantly updated instead of old factory settings. Unless the end user knows what to look for, there will be little chance of these recovery partitions destroyed accidentally, especially when most users are given administrative rights to their machines. The difference in partition type also helps to protect the partition from Windows viruses - though it's rare for viruses to attack data files.
     

Share This Page