Linkshare rotating banner
Showing posts with label computer. Show all posts
Showing posts with label computer. Show all posts

Thursday, October 4, 2012

Disk Cloning / Imaging over Network with SSH, Netcat, DD and XZ

Today we have affordable, ample storage and faster bandwidth to facilitate partition imaging and disk cloning over network. Nowadays, it's common and feasible to take the image of a whole partition for various reasons. Compared to file-based backups using tar, disk imaging provides the following advantages.




  • The boot sector is preserved so that it's easy to make it bootable after the restore.
  • Information such as UUID and LABEL is presered, which helps identify the partition in booting and mounting.
  • Information such as ACL and XATTR is preserved, which helps restrict file access and secure the system.
  • Every bit in the unused sectors is preserved, which may assist in digital forensics to uncover deleted or hidden information.


There are commercial programs for disk imaging and backup (Norton Ghost, Acronis True Image). However, Linux users can use readily available tools to get things done. For disk cloning/imaging, we can use ssh, netcat, dd and xz. Note that dd will fail on physically damaged disks. For such disks, use ddrescue instead.



For security and compression, we are going to use ssh and xz in this tutorial. If you don't like xz, feel free to substitute xz with gzip, bzip2 or lzop. Also, netcat is used to stream the dd output over the network. On Debian and Ubuntu derivatives, you need the following packages.




  • bzip2, gzip, lzop, lzma OR xz-utils
  • dd
  • netcat
  • ssh


We are making these assumptions in the following scenarios.




  • Sending computer S

    This computer has IP address 192.168.1.1 and needs to back up partition /dev/sda1.
  • Sending Port

    We'll send using port 5525.
  • Receiving computer T

    This computer has IP address 192.168.1.2 and needs to restore partition /dev/sda2.
  • Receiving Port

    We'll receive at port 7749.


Disk Cloning using dd, xz, netcat and ssh


In this scenario, we will clone a disk partition, simultaneously sending an image of the source partition /dev/sda1 from computer S (192.168.1.1) and restoring it at /dev/sda2 on computer T (192.168.1.2). Make sure that the source partition is not mounted or is mounted read-only. Also, make sure that the target partition size is greater than or equal to the source partition size.




  1. At the sending computer, compress the source partition /dev/sda1 with xz and set up netcat to send it at port 5525:

    dd if=/dev/sda1 bs=16M | xz | nc -l 5525

  2. At the receiving computer, set up a SSH tunnel to the sending computer (192.168.1.1):

    ssh -f -N -L 7749:127.0.0.1:5525 username@192.168.1.1

  3. At the receiving computer, type the following command to receive the partition image and restore it at /dev/sda2:

    nc 127.0.0.1 7749 | xz -d | dd of=/dev/sda2 bs=16M



Alternatively, we could take the following steps to achieve the same thing. However, we start at the receiving computer.




  1. At the receiving computer with the target partition /dev/sda2, type the following command to receive the partition image:

    nc -l 7749 | xz -d | dd of=/dev/sda2 bs=16M

  2. At the sending computer with the source partition /dev/sda1, set up a SSH tunnel to the receiving computer (192.168.1.2):

    ssh -f -N -L 5525:127.0.0.1:7749 username@192.168.1.2

  3. At the sending computer, type the following command to compress the source partition /dev/sda1 and transmit it over the SSH tunnel:

    dd if=/dev/sda1 bs=16M | xz | nc 127.0.0.1 5525

    Note that the transfer may take many hours for a large partition.




Disk Imaging using dd, xz, netcat and ssh


In this scenario, we will just send an image of the source partition /dev/sda1 to the receiving computer T (192.168.1.2) without restoring it. Make sure that the source partition is not mounted or is mounted read-only. A question remains whether to compress the image at the sending or receiving computer. The answer depends on which computer is more powerful. For this example, we'll compress at the sending computer (for network bandwidth reason).




  1. At the sending computer, compress the source partition /dev/sda1 with xz and stream it using netcat:

    dd if=/dev/sda1 bs=16M | xz | nc -l 5525

  2. At the receiving computer, set up a SSH tunnel to the sending computer (192.168.1.1):

    ssh -f -N -L 7749:127.0.0.1:5525 username@192.168.1.1

  3. At the receiving computer, type the following command to receive the file:

    nc 127.0.0.1 7749 > partimg.xz



Alternatively, we could take the following steps to achieve the same thing.




  1. At the receiving computer, set up netcat to listen at port 7749 and save the incoming data to a file partimg.xz.

    nc -l 7749 | dd of=partimg.xz bs=16M

  2. At the sending computer, establish a SSH tunnel to the receiving computer (192.168.1.2) first:

    ssh -f -N -L 5525:192.168.1.2:7749 username@192.168.1.2

  3. At the sending computer, type the following command to compress the source partition /dev/sda1 and transmit it over the SSH tunnel:

    dd if=/dev/sda1 bs=16M | xz | nc 127.0.0.1 5525

    Note that the transfer may take many hours for a large partiiton.




Alternative Simple Commands for Disk Cloning / Imaging


I don't like these methods for some reason, but here I show the simpler methods where netcat is not needed. For disk cloning, type something like this:



dd if=/dev/sda1 bs=16M | xz | ssh username@192.168.1.2 "xz -d | dd of=/dev/sda2 bs=16M"


Just to send an image file, run a command as follows:



dd if=/dev/sda1 bs=16M | xz | ssh username@192.168.1.2 "dd of=partimg.xz bs=16M"


Also Read:


Wednesday, December 29, 2010

ssh + netcat + tar + xz = Secure Network Transfer Link

I found a way to use simple command-line tools to transfer files between computers far apart. Using this method, I was able to duplicate the contents of an entire filesystem securely over a SSH tunnel between two computers. In this method, no NFS server or scp command is needed. However, netcat plays an important role in this method. Let's first make sure we have everything ready.



  • OpenSSH
  • netcat
  • tar or cpio
  • xz, lzma, lzo, bzip2 or gzip


I'll be really brief.




  1. At the computer where you will receive files (say, 192.168.1.2), type the following commands to start netcat in listening mode and use tar + xz to unpack the incoming stream of data.



    cd /my/downdoad/folder
    nc -l 7749 | xz -dc | tar xvf -


  2. At the computer where you will send files (say, 192.168.1.1), create a ssh tunnel to the computer receiving files (192.168.1.2).



    ssh -l username -L 5525:192.168.1.2:7749 192.168.1.2


  3. Open another terminal window and type the following command to start sending files.



    tar cvf - . | xz -c | nc 127.0.0.1 5525


Partition Imaging with Netcat



Backing up hard drive partitions over the network can be accomplished with just a few simple tools like netcat. This is another handy usage of netcat. At the receiving computer where you'll store the backup, type the command to receive the partition image:



nc -l 7749 | lzma -dc | dd of=/dev/sda8 bs=640K


At the sending computer from which you'll transmit the partition, establish an SSH link first:



ssh -l username -L 5525:192.168.1.2:7749 192.168.1.2


Then compress the partition data and transmit over the secure SSH channel:



dd if=/dev/sda11 bs=640K | lzma -9c | nc 127.0.0.1 5525


Note that the transfer may take many hours for a large partition.

Saturday, August 21, 2010

Debian Linux: Simple steps to recover files from /lost+found

The following steps illustrate how one can use simple shell commands to recover files from the /lost+found directory in Linux. This assumes that you actually have some files in /lost+found.




  1. First, concatenate all the *.md5sums files in /var/lib/dpkg/info into a single file:


    cd /var/lib/dpkg/info
    cat *.md5sums | sort -k 2 > /tmp/all.md5


  2. Go to the /lost+found directory. fsck may have placed some files here after fixing the Linux partition. If you don't find any file here, you can relax and skip the following steps. Run md5sum on files in /lost+found.


    cd /lost+found
    md5sum * | sort > /tmp/lost.md5


  3. Put only the md5sum values into a temporary file, called 0.txt.


    awk '{print $1}' /tmp/lost.md5 > /tmp/0.txt


  4. Search all.md5 for the md5sum values in 0.txt and save the results in 1.txt.


    for f in $(cat /tmp/0.txt); do grep $f all.md5 >> /tmp/1.txt; done


  5. Put the names of files in /lost+found into a temporary fie 2.txt.


    awk '{print $2}' /tmp/lost.md5 > /tmp/2.txt


  6. Move the lost+found files to their original locations.


    cd /
    for $f in $(cat /tmp/2.txt); do MD5=$(grep $f /dev/shm/lost.md5 | awk '{print $1}'); ORIGIN=$(grep $MD5 /tmp/1.txt | awk '{print $2}'); mv /lost+found/$f /$ORIGIN; done

Wednesday, July 28, 2010

Checking Integrity of A Debian/Ubuntu System

Sometimes, a Linux filesystem becomes corrupted, system files are damaged, or some crucial files get lost. This often happens, regardless of which filesystem (ext2, ext3, ext4, jfs, reiserfs, reiser4, or xfs) is used. There are many possible reasons, such as:



  • Unstable hardware, for example, memory or hard drive problem
  • Overheat, power surge, quake or another environmental disaster
  • Buggy software, such as a bug in the kernel or the filesystem driver
  • Compromised security, for example, network intrusion or attack
  • Worm or virus infection


Files in Linux systems can be categorized into the following three:




  1. Verifiable System Files

    In Linux systems that are managed by packages (such as Debian and Ubuntu), these files are installed by packages and make up the bulk of the filesystem. These files reside in such directories as /bin, /lib, /sbin and /usr. They are usually static, which means they don't normally change except when the system is updated, or locally compiled binaries are installed.
  2. Changeable System Files

    These files are auxiliary system files for system configuration, initialization or customization, and system data (such as logs and cache). They reside in /boot, /etc, /opt, /srv and /var.
  3. User Data

    These files are created and used by superuser (a.k.a root) and normal users, or software-generated during casual user activities. Typically, they are in /home, /media, /mnt and /root.


This post focuses on verifiable system files (installed by packages). When the filesystem becomes corrupted (but not completely unreadable), it is possible to verify and restore the system integrity by using package checksums. Before you continue, make sure to fsck the filesystem.



e2fsck -r -v /dev/sda7


In this example, /dev/sda7 points to an ext2 partition we're going to check. Be aware that you cannot fsck a mounted filesystem. Therefore, boot with a Debian Live CD (or a Ubuntu CD) and run fsck. After you've performed fsck, there may be some files created in the /lost+found directory. We'll deal with them later. First, mount the filesystem.



mount -t ext2 /dev/sda7 /mnt


Go to /var/lib/dpkg/info. Then, concatenate all the md5sums files. Most, if not all, Debian and Ubuntu packages come with a md5sum file that we can use to check the integrity of the package and the files installed by the package.



cd /var/lib/dpkg/info
cat *.md5sums | sort > /dev/shm/all.md5


all.md5 has md5 checksums of all the files installed on the system. Now, check the files on the Debian/Ubuntu system against the concatenated md5sums file.



cd /
md5sum -c /dev/shm/all.md5 > /dev/shm/check.txt 2>&1


/dev/shm/check.txt now contains the results of the integrity check. It looks like this:



bin/bash: OK
bin/bunzip2: OK
bin/bzcat: FAILED


In this example, /bin/bzcat is damaged. To find all the missing or damaged files, use a command like this one:



grep -v ': OK$' /dev/shm/check.txt


Let's reinstall this file. First, find out which package this file belongs to.



dpkg -S /bin/bzcat


We'll see the following result.



bzip2: /bin/bzcat


Now we know that we need to reinstall bzip2. Let's download the package.



dpkg -p bzip2 | grep 'Filename: '


This command will let us know the name of the package to download. Use wget to download it.



wget ftp://ftp.us.debian.org/debian/pool/main/b/bzip2/bzip2_1.0.5-4_i386.deb


You can just reinstall the package.



dpkg -i bzip2_1.0.5-4_i386.deb


Or, you can just extract one file:



dpkg --fsys-tarfile bzip2_1.0.5-4_i386.deb | tar xf - ./bin/bzcat


Alternatively,



dpkg --fsys-tarfile bzip2_1.0.5-4_i386.deb | tar xOf - ./bin/bzcat > /mnt/bin/bzcat


To restore a file from the /lost+found directory, you can also use the MD5SUMS file. First, run md5sum on files in /lost+found.



cd /lost+found
md5sum *


You may get an output like this.



9aaa2176d20c1b1203e3abbac55a2513  #124531


To find out what #124531 file is originally, find its md5 checksum from the all.md5 file above.



grep 9aaa /dev/shm/all.md5


You'll get a result like this.



9aaa2176d20c1b1203e3abbac55a2513  bin/bzip2


Now you can just move it to its place.



mv \#124531 /mnt/bin/bzip2


After you restore all damaged files and restore files from /lost+found, you can find missing files in the system. Go to /var/lib/dpkg/info again and concatenate all the list files.



cd /var/lib/dpkg/info
cat *.list | sort | uniq > /dev/shm/all.txt


The .list files in the /var/lib/dpkg/info directore show the list of files installed by packages. Let's find what's missing from the system.



cd /
for f in $(cat /dev/shm/all.txt ); do test -e "$f" || echo "$f" >> /dev/shm/nonexist.txt ; done


The file /dev/shm/nonexist.txt will show which files are missing from the system. You can then replace the missing files as done previously.

Monday, July 26, 2010

Linux: Using dd To Back Up Hard Drive Partitions

I am going to use the omnipresent and omnipotent tool called dd to back up a hard drive partition. I am working with the drive /dev/sdb. First, I save a text file that has information on the partition table layout.



fdisk -l /dev/sdb > hdpt.txt
fdisk -l -u /dev/sdb >> hdpt.txt


Then, I choose the compression format to use for the backup archive.


  • gzip
  • bzip2
  • lzma
  • xz


My choice for the compression format is lzma which provides superior compression and faster decompression. The following command backs up a partition at /dev/sdb1 with dd and lzma.



dd if=/dev/sdb1 | lzma -9c > backup01.bin.lzma


To restore this backup later, use the following command:



lzcat backup01.bin.lzma | dd of=/dev/sdb1

Wednesday, November 25, 2009

Writing and Verifying a Floppy Image

First format a floppy with the following command:



fdformat /dev/fd0 (in Linux)
fdformat /dev/rfd0c (in OpenBSD)
format A: (in DOS)


Linux and OpenBSD


Insert a floppy and use the dd command to write an floppy image to the floppy diskette.



dd if=floppy46.fs of=/dev/fd0 bs=32k (in Linux)
dd if=floppy46.fs of=/dev/rfd0c bs=32k (in OpenBSD)


Use the following command to make sure that the image is written correctly to
the floppy.



cmp /dev/fd0 floppy46.fs (in Linux)
cmp /dev/rfd0c floppy46.fs (in OpenBSD)


Windows and DOS


If you use Windows XP, Vista or Windows 7, use fdimage or ntrw to write the boot floppy. Make sure the floppy has been formatted first.



C:\> ntrw floppy46.fs a:
3.5", 1.44MB, 512 bytes/sector
bufsize is 9216
1474560 bytes written


Or,



C:\> fdimage -q floppy46.fs a:


In Windows 9x/ME or DOS, you can use rawrite to write your boot floppy.



C:\> rawrite
RaWrite 1.2 - Write disk file to raw floppy diskette

Enter source file name: floppy46.fs
Enter destination drive: a
Please insert a formatted diskette into drive A: and press -ENTER- :

Sunday, October 18, 2009

Setting Up Windows 7 on Compaq Presario V5306US

I installed Windows 7 Home Premium on my old Compaq Presario V5306US notebook. Installation went without a problem, but 3 hardware components were not detected. They are:


  • ATI Mobility RADEON XPRESS X200M Series

  • In-Build Conexant ATI AC '97 Modem

  • HP Quick Launch Buttons


Since both of the built-in Ethernet and wireless network adapters are detected by Windows 7, I started Windows Update and installed the display driver through Windows Update. Drivers for the modem and quick launch buttons can be downloaded from HP/Compaq support site. For the quick launch buttons, extract the package with 7-zip and only install the driver.

The following pictures are taken from the device manager that list devices available in Compaq Presario V5306US.








Tuesday, October 13, 2009

Disabling Office Genuine Advantage

To Uninstall OGA


Microsoft has released Office Genuine Advantage notification though Windows Update that displays an annoying message every time you start an Office application. The message says that the installed copy of Microsoft Office is not genuine. To get rid of this annoying thing, follow the steps below:



  1. Start the Windows registry editor from the Start menu. To find the Windows registry editor, type regedit into the Search box.

    Start_Windows_Registry
  2. Go to the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall in the left pane. Press Ctrl+F or select Find... from the Edit menu. In the Find dialog, type OGA and press Enter.

    Find_OGA_Registry_Key
  3. You'll be taken to the registry key for the OGA installer. In the right pane, double-click UninstallString. Select the value data and copy it by pressing Ctrl+C.

    OGA_Uninstall_String
  4. Open the Start menu. Start the Command Prompt from the Accessories menu as administrator.

    Start Command Prompt as Administrator
  5. Paste the UninstallString above into the Command Prompt.

    Paste_in_Command_Prompt
  6. Run the command. Typically the command looks like:

    MsiExec.exe /X{B2544A03-10D0-4E5E-BA69-0362FFC20D18}

Thursday, September 17, 2009

Using GRUB To Boot Windows XP with a Floppy Image

I had trouble booting Windows XP installed in a logical partition. I guess the boot sector of the logical partition was damaged. I had to boot this installation of Windows XP by chainloading from another Windows XP on a primary partition. But without another Windows XP partition, I can boot Windows XP from a floppy diskette although floppy diskettes are not in much use nowadays.



I created a Windows XP boot floppy by following instruciton on this article on the Microsoft site. Then, I booted Linux and made an image file of the boot floppy.


dd if=/dev/fd0 of=ntboot.bin bs=512

Save the image file somewhere in your hard drive. Then, when you start the computer, use the following GRUB commands to boot Windows XP.


kernel (hd0,6)/boot/grub/memdisk bigraw
initrd (hd0,6)/boot/grub/ntboot.bin

memdisk is a part of the syslinux package.


Here's my XP boot image to be used with GRUB or syslinux: ntboot.bin. Before actually using it, make sure to edit BOOT.INI in it.

Wednesday, September 16, 2009

GRUB and NTFS boot sector

After messing with the hard disk partitions, Windows XP installations in logical partitions failed to bootstrap directly. However, I finally managed to boot Windows XP on a logical partition by chainloading from another XP on a primary partition. This required me to edit the file BOOT.INI on the primary XP partition.


I suppose the boot sector of the logical partition is broken. I booted Linux and extracted the boot sector from the primary partition containing Windows XP.


dd if=/dev/sda2 of=xpboot.bin bs=512 count=1

I experimented with this boot sector and GRUB. At boot time, I typed the following GRUB command.


chainloader (hd0,5)/xpboot.bin
boot

This allowed me to boot Windows XP. However, the XP boot sector apparently reads BOOT.INI from the primary partition. I will analyze the boot sector file with an Hexadecimal editor. By studying the NTFS boot sector, I will be able to solve Windows XP boot problems.

Sunday, September 13, 2009

Booting Windows Vista/7 From a Logical Partition

It is possible for Windows Vista and Windows 7 to be installed on logical partitions. Windows Vista and Windows 7 use the new bootmgr bootloader to start themselves as opposed to ntldr used by old NT-based operating systems like Windows XP. Therefore, booting Windows Vista/7 from a logical partition takes a different approach from booting Windows XP from a logical partition.



Installing Windows Vista/7 onto a Logical Partition


Windows Vista/7 can be installed into a logical partition at the time of first installation. However, a new primary NTFS partition will be created. This partition is about 100 MB and only contains essential bootloader files, such as bootmgr and BCD. If you intend to remove this Vista/Win7 boot partition, be sure to copy its contents (especially bootmgr and BCD) to the logical partition containing Windows Vista/7 beforehand.

After that, reboot with Vista/Win7 installer CD, choose “Repair Your Computer” and proceed to invoke the Command Prompt. Type the following commands to enable Vista/Win7 to boot from a logical partition.


C:
bcdedit /enum /store C:\Boot\BCD
bcdedit /store C:\Boot\BCD /set {bootmgr} device partition=C:

Restart your computer. Put a CD into CD-ROM that has GRUB bootloader. Most Linux install CD's use GRUB these days. When you see the Grub boot menu, press C or Esc. You are now on the GRUB command line. To find which partition is your Windows partition, type root (hd0, and then press Tab. Windows partitions are mostly type 7. For example, if your Windows partition is (hd0,5), type the following commands to boot Windows.


root (hd0,5)
chainloader +1
boot

The reason why we want to remove the boot partition is most likely because we want to free a primary partition for use by another OS, such as OpenBSD or OpenSolaris. However, in order to boot Windows from a logical partiton, you need to set up a special bootloader, for example, GRUB.



Copying Windows Vista/7 from Primary to Logical Partition


If you installed Windows Vista/7 on a primary partition and want to move it to a logical parition, we need GParted to manipulate partitions. To get GParted, I recommend you to download one of the following ISO's:



Use GParted to copy Windows Vista/7 from a primary partition to a logical partition. Then, delete the original primary partition containing Windows Vista/7. Grab your Windows Vista/7 install DVD and reboot your PC with it. Click “Repair Your Compure” option and open a Command Prompt. Type the following commands to fix the C:\Boot\BCD file.


C:
bcdedit /enum /store C:\Boot\BCD
bcdedit /store C:\Boot\BCD /set {bootmgr} device partition=C:
bcdedit /store C:\Boot\BCD /set {default} device partition=C:
bcdedit /store C:\Boot\BCD /set {default} osdevice partition=C:

Reboot. Use the following GRUB commands to start Windows Vista/7. In this example, (hd0,5) is the logical partition that has Windows Vista/7.


root (hd0,5)
chainloader +1
boot


Validating the System Restore Drive


After booting Windows Vista/7, open the System Properties dialog and make sure that the Available Disks in System Protection tab are all valid.


System Protection Tab

Related Posts


Thursday, August 27, 2009

Notes on Toshiba Mini NB205

I recently bought a netbook made by Toshiba. Its model is NB205 black. So far I love this stylish notebook. It is light so it doesn't weigh heavily on my shoulder when I carry it in my backpack to school. It has a very long battery life (almost 8 hours) and it's surprisingly powerful enough. I'll keep notes about Toshiba Mini NB205 on this post. I will update it with useful information about Toshiba NB205.


Toshiba Mini Netbook NB205

Notes on Toshia NB205 Hardware



IDE/SATA Driver for Windows XP and Vista


I tried to install Windows XP and Vista on my Toshiba netbook. XP/Vista installer crashed many times unless I loaded Intel AHCI driver in the beginning of the installation. The netbook's 160GB hard drive is connected to Intel 82801GBM Serial ATA controller inside the netbook. I downloaded the text-mode driver (f6flpy3289.zip) from Intel support site. I unpacked driver package onto a USB floppy. The needed files are as follows:

iaahci.cat
iaahci.inf
iastor.cat
iastor.inf
iastor.sys
license.txt
readme.txt
txtsetup.oem

Then, I connected the USB floppy to my netbook before booting with XP/Vista installation CD/DVD in my USB DVD-ROM. I pressed F6 right after the XP installation started. A few minutes later, I was asked to choose the right driver from a list of drivers. Only one choice works; that's Intel(R) ICH7M/MDH SATA AHCI Controller.


After Windows XP is successfully installed, install the Intel Matrix Storage Manager (IATA89CD.exe.)



Other Drivers


The Toshiba support site offers many drivers and software for Toshiba Mini NB205. Download the following drivers when reinstalling Windows XP.




Applets for Toshiba NB205


TouchPad Driver


I downloaded Alps TouchPad Driver 7.4.2002 for Vista from SoftPedia. I extracted Vi32 folder from the package using 7zip and installed the driver by running DPinst.exe.



Chicony Camera Assistant Software for Toshiba


I downloaded the camera software from Toshiba. This software also works on Windows Vista and Windows 7.



HDD Protection Software for Windows XP/Vista/7


Toshiba Mini NB205 has a vibration sensor for safe-guarding the hard drive. HDD protection software uses a reading from the vibration sensor and temporarily put the drive in halt when significant vibration is detected. If you reinstall XP on Toshiba NB205, download the HDD protection software from Toshiba and install it. The software also installs the driver for HDD vibration sensor.



Toshiba NB205 Has SLIC 2.1 for Windows 7


Using SLIC Dump ToolKit V2.3, I learned that Toshiba Mini NB205 contains SLIC 2.1 in its BIOS ACPI table. That means an OEM version of Windows 7 can be installed on NB205 and activated with the right OEM certificate and key.


SLIC Dump Toolkit V2.0

Related Links


Friday, July 10, 2009

Vista: Sharing Wireless Internet Connection with Ad-Hoc Network

Wireless networks are so common today. Yet, one shortcoming of wireless networks is that sometimes the signal from the access point (a.k.a wireless router) cannot reach all your computers due to various reasons, such as a physical obstacle or interfering signals. In such cases, we can set up a computer in reach of the access point to act as a gateway to out-of-reach computers in an ad-hoc wireless network. Then, Internet Connection Sharing feature of Windows Vista will be used to extend your wireless network. Let's assume we have computer A within the range of a wireless router, therefore can access the Internet. Also, we have computer B that's near computer A but too far from the wireless router.


WirelessBridge

To help computer B access the Internet, we need 2 wireless adapters for computer A and one for computer B. Now, set up computer A to access the Internet via wireless router as usual.


Vista Control Panel Network and Sharing Center

At the same time, with the extra wireless adapters, set up an ad-hoc wireless network between computer A and computer B. To do so, select Set up a connection or network in the left side of the Network and Sharing Center (See the picture above). This brings up the following window. Select Set up a wireless ad-hoc (computer-to-computer) network and click Next.


net03

Choose the secondary wireless network connection of Computer A that will be used to communicate with computer B.


net04

Set up a wireless ad-hoc network in the next windows.


net06

Don't choose Turn on Internet connection sharing yet.


net07

After you set up a wireless ad-hoc network, bring up the Network Connections window.


Vista Control Panel Network Connections

Right-click the primary wireless network connection and choose Properties. In the Sharing tab, enable Internet Connection Sharing as follows:


Internet Connection Sharing

Now, go to computer B and connect to the ad-hoc network you just created. In most cases, you'll be able to access the Internet. If not, bring up the Network Connections, right-click the Wireless Network Connection and select Properties in the right-click menu.


net12

In the Network Properties window, select Internet Protocol Version 4 (TCP/IPv4) and click Properties.


net13

In case computer B still can't access the Internet, manually set up its connection like this:


net14

Wednesday, July 8, 2009

Windows ME Drivers for VIA EPIA-M 10000

Today I restored Acronis TrueImage backup of Windows ME on my computer that has VIA EPIA-M 10000 motherboard. Because the backup was made on a different system, Windows ME recognized new hardware upon the first boot. There were some hardware components that Windows ME couldn't find the driver for, so I had to search and download the drivers from the Internet. The following is the list of Windows ME drivers that need to be installed additionally for VIA EPIA-M 10000.




Windows XP Drivers for VIA EPIA-M 10000


If you install Windows XP on a computer with VIA EPIA-M 10000 motherboard, you need to get the following drivers.


Monday, July 6, 2009

Ripping a Bootable Acronis TrueImage Diskette

I am trying to incorporate Acronis TrueImage into my bootable Linux CD. Acronis TrueImage is backup software that saves the entire hard disk partition of Windows or Linux system. In short, I am going to use the Bootable Rescue Media Builder to turn my Zip100 or 128MB USB flash into a rescue media, rip it with WinImage and then copy it into my CD. Here's how I did step-by-step:


Start the Bootable Rescue Media Builder under Aronis Start menu.


Bootable_Rescue_Media_Builder_01

In the Rescue Media Contents Selection window, check Acronis True Image Home (Full version) at the left and check Start automatically after 10 sec. at the right. Then, click Next.


Rescue_Media_Contents_Selection

Plug in your USB flash. At the present, any media larger than 64MB will do. That means 128MB USB flash is the minimum. I am using 100MB Zip diskette. At the Bootable Media Selection window, choose a Removable Disk that's blank and more than 64MB, but not Floppy Diskette nor ISO image.


Bootable_Media_Selection

Acronis Media Builder says it's ready to start the media creation process.


Acronis_Media_Builder_Ready

Click Proceed. Acronis Media Builder formats the drive and copies files to it.


Acronis_Media_Builder_Processing

Upon completion, check your rescue media.


Acronis_Media_Builder_complete

Ripping the partition with Linux dd


Now, reboot to Linux and open xterm or your favorite terminal emulator. Plug in your USB flash if you haven't done so. Linux will automatically detect your USB drive. To find the device name of your USB drive, type:


dmesg | tail

dmesg will show the drive letter of the USB flash that was just plugged in. In case your USB flash is /dev/sdc1, type the following command:


dd if=/dev/sdc1 of=sdc1.bin bs=512

This saves the partition of Acronis rescue media as sdc1.bin. Copy it to your Windows partion. Then, reboot to Windows.



Using WinImage to Resize the Partition Image


Download and install WinImage.

Saturday, June 27, 2009

Removing Malware from Windows XP

This is a simple trick to remove spyware or malware from Windows XP. I used it to fix my friend's computer. His PC was infected with bogus Anti-virus called System Security version 4.52. This malware reports virus infection and asks me to buy their software. It also disables other real anti-virus like AVG and blocks the user from accessing legitimate sites like Anti-virus vendors and the Microsoft site. Don't be tricked into giving them your valuable credit card number! This bogus malware is a scam. Just follow these simple steps to get rid of this kind of evil creatures.




  1. Restart your computer and hold down the F8 key. You'll see a menu of boot options. Choose the Safe Mode with Networking so you can go online and download Anti-virus like AVG or Avast!

    Windows XP advanced boot menu
  2. Once you're in the Safe Mode, launch the registry editor (regedit.exe).
  3. Go to “HKLM\Software\Microsoft\Windows\CurrentVersion\Run”
  4. Find anything suspicious and note the location of the perpetrator. In my case, it looks like:

    10479844  "C:\Documents and Settings\All Users\Application Data\10479844\10479844.exe"

  5. Remove it from the registry.
  6. Open the explorer and remove the folder containing the malware/spyware/scumware from the system.

Monday, April 6, 2009

OEM SLIC tables for Windows Vista

I was researching the activation scheme behind Windows Vista OEM computers. Computers with pre-installed Windows Vista have a special license embedded in their ACPI BIOS, called SLIC table. This kind of a hardware-based activation scheme was designed to prevent software piracy. Nonetheless, there's a way to create a SLIC table in the BIOS with the help of software. This method is sometimes called SoftMod or just Vista Loader.


Using the SoftMod method, one can insert the SLIC signature of a certain hardware manufacturer into the BIOS and apply a copy of a license file (*.xrm-ms), then have Windows Vista activated. The first SLIC code that was leaked widely belongs to the (infamous) ASUS notebook manufacturer. After ASUS, more and more SLIC codes have been discovered and exploited.


Obviously, using a SLIC code that's spread and used widely makes it vulnerable to Windows updates that are designed to defeat circumventive measures against software activation. Therefore, uncommon SLIC signatures are better than the common ones. Vista Loader 3.0.0.1 includes OEM BIOS emulation codes of the following vendors:



  • AMD
  • AMD64
  • Acer
  • Asus
  • COMPAQ
  • Dell
  • Emachines
  • Fujitsu-Siemens
  • Gateway
  • Hewlett-Packard
  • Intel
  • Levono
  • Medion
  • NEC
  • Packard Bell
  • Samsung
  • Sony
  • Toshiba

Among these vendors, MEDION seems to be the most obscure one. Anyway, I found more vendor SLIC codes by downloading AMI_SLIC3_20080419.rar.

Saturday, April 4, 2009

Fixing a Vista Boot Problem

Error: Press Ctrl+Alt+Del to restart


I restored a partimage backup of Windows Vista. The backup was originally made from the partition /dev/sda2, but I deleted /dev/sda1 and created a new partition at /dev/sda1 with the same size as the backed-up partition. Then I restored the backup on /dev/sda1.


Upon reboot, Windows Vista couldn't start. Instead I received an error:


A disk error occurred.

Press Ctrl+Alt+Del to restart.

After many attempts, I finally fixed the problem. Here I show how I did it:



  1. Put your Vista installation DVD into your DVD drive and restart your computer. When you see the message "Press a key to boot from DVD", press any key.
  2. When the Install Windows screen appears, click Repair your computer.
  3. You may see Vista automatically trying to detect a boot problem and fix it. When a boot problem is detected, you'll get a dialog with a choice to fix the problem or ignore it. Just cancel and close the dialog.
  4. You'll be shown a window with many repair options. Open a command prompt.
  5. Type the following commands. It is assumed that Windows is installed in C: Replace C: with the correct letter if it's different:
    chkdsk C: /f
    C:
    bootrec /FixMBR
    bootrec /FixBoot
    bootrec /ScanOs
    attrib -r -s -h c:\boot\bcd
    del c:\boot\bcd
    bootrec /rebuildbcd

  6. Restart your computer and see if Vista can start.


Error: Winload.exe is missing or corrupt


Windows failed to start. A recent hardware or software change might be the cause. To fix the problem:
1. Install your WIndows installation disk and reboot.
2. Choose your language settings, click Next
3. Choose "Repair your computer"

File: \Windows\system32\winload.exe
Status: 0xc0000225
Info: The selected entry could not be loaded because the application is missing or corrupted

This problem occurs when the UUID of the NTFS partition is changed after resizing or moving the Windows partition with GParted or Acronis Disk Director. This problem can be easily fixed if you have a Windows install DVD. Put the Windows install DVD in your CD-ROM and Reboot your computer. Select “Repair your computer” and cancel Automatic Repair. Open a Command Prompt and type the following commands:


C:
bcdedit /enum /store C:\Boot\BCD
bcdedit /store C:\Boot\BCD /set {bootmgr} device partition=C:
bcdedit /store C:\Boot\BCD /set {default} device partition=C:
bcdedit /store C:\Boot\BCD /set {default} osdevice partition=C:

Saturday, March 28, 2009

Cleaning Up Windows Vista

This post will eventually be a collection of tips on cleaning up and trimming Windows Vista.



Emptying the Recycle Bin


Emptying the recycle bin is the easiest and most common way for people to clean up Windows. Even if you don't, Windows will automatically remove the oldest trash from the recycle bin when it fills up.



Deleting Temporary Files


As you use your computer, Windows and applications save temporary files in the folder dedicated for temporary storage. These temporary folders are given the variable name %TEMP% or %TMP% — in most cases, %TEMP% and %TMP% are identical. Ideally, applications are supposed to remove temporary files after they finish their jobs, but sometimes they forget to remove temporary files. Thus, once in a while, you have to remove temporary files yourself.


To remove temporary files, follow the following steps:



  1. Open the Explorer — the default file browser in Windows. You can do so by opening My Computer, My Document, My Pictures or My Music.
  2. Type in the address bar %TEMP% and press Enter.

    Go to %TEMP% folder.
  3. You'll be taken to the temporary folder, typically C:\Users\YourName\AppData\Local\Temp. Remove any temporary files and folders existing inside that folder.
  4. If %TEMP% and %TMP% are different, also do the same for %TMP% folder.


Cleaning Up VirtualStore


With strict User Access Control (UAC) in effect, Vista places user-generated files in the VirtualStore folder when a program wants to save something in the restricted area of filesystem. Type %APPDATA% in the address bar of the Windows explorer. Then, descend to Local/VirtualStore. Note that not everything there should be deleted as some of them are user settings.



Deleting Windows Updates


Windows updates are necessary to make Windows Vista secure and efficient. However, after updating Windows, some update files are left over and take extra space. The following steps delete these left-over update files.



  1. Open the Start menu, right-click Computer and select Manage.
  2. In the left pane, expand Service and Applications and select Services.
  3. In the right pane, select Windows update service and stop the serive.
  4. Open Computer in the explorer and go to C:\Windows\SoftwareDistribution
  5. Go to the DataStore folder and delete all files and folders there.
  6. Go back and change to the Download folders. Remove all files and folders there.
  7. Restart the Windows Update service.

Friday, January 2, 2009

Project Directive: Building an Industrial PC

Project Directive


This directive outlines the purpose and requirements of the computer to be built in the near future.



Purpose of the Product


The machine will serve various purposes as stated below.



  1. Internet Gateway: The machine will be running almost always with constant wired or wireless connection to the Internet. The machine will have a gateway capability to connect other machines to the Internet via an Ethernet switch or wireless connection.
  2. Network Server: The machine will store and serve files (ex. pictures, music, movies, etc.) to clients both on private network and the Internet. However, the served files shall be stored and retrieved from an external storage device connected via USB, Firewire or eSATA.
  3. Internet Entertainment: The machine may be casually used to browse the Internet, hang out in social networks, read news, check Web mail and engage in text/voice/video conversation with others on the Internet.
  4. Multimedia Player: The machine will be able to play music, Internet radio and movies on stereo system, TV or monitor. It may be optionally controlled by a remote controller, wireless keyboard or mouse.
  5. Time-consuming Computations: The machine will optionally perform various computational tasks such as compilation of executable codes, encryption, decryption, statistical analysis and conversion of data.


Hardware Requirements


The machine shall occupy minimal space, and operate quietly and energy-efficiently.



  1. Its circuit board will be in Pico-ITX (100x72mm), Nano-ITX (120x120mm), Mini-ITX (170x170mm), or similarly compact form.
  2. The CPU will be Mobile AMD Sempron, VIA Nano or Intel Atom. In order to maintain quiet operation, it is recommended that the CPU have no fan attached.
  3. At least 256MB of volatile memory is required. SODIMM-type memory is recommended.
  4. Non-volatile memory will take the form of compact flash, Solid-State Drive or 2.5 inch hard drive. At least 256MB of non-volatile memory is required. Additional storage will be attached externally through USB, Firewire or eSATA ports.
  5. The machine will have a minimum number of external connectors such as one PS/2, VGA, S-Video, audio in/out, LAN and at least 2 USB ports. No serial or parallel port is required.
  6. The machine will contain no floppy or CD-ROM drive.


Software Requirements


The primary operating system will be Linux. Optionally, Windows XP or Windows Vista will be installed as a dual-boot option.



  1. The non-volatile memory storage in the system will store a functional boot loader that can boot the system from internal storage, external storage attached via USB/Firewire/eSATA, or network storage via BOOTP/TFTP.
  2. It is optional but recommended for the internal storage to contain a functional Linux operating system that meets the project purposes stated above. No private user-specific information shall be stored. For stability and data integrity, it is also recommended to write-protect the operating system and disable modification for a long period of time. Periodically (monthly, quarterly, every 4 months, or semianually), the whole operating system will be unlocked, updated with newer versions, and optimized with new settings.
  3. If Windows operating system is to be used, it will be installed on a USB hard drive and started by the boot loader.
  4. All variable/extraneous settings and data will be stored externally on a USB flash or USB hard drive.
  5. The machine should allow remote logins by local computers via SSH, HTTP, VNC or Remote Desktop sessions.


Candidate Parts


About This Blog

KBlog logo This blog seeks to share useful information on hottest movies available on the Internet. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger