Transferring Files with a Crossover cable and Two Linux Rescue CDs


References
  1. Hardware - Making Your Own Crossover Cable
  2. Rescue Boot CD - PLoP Linux
  3. FTP Server - ProFTPd, ( Server Directives)
  4. FTP Client - ftp
  5. Text Editor - Vi Manual
  6. Network Utility - ifconfig
  7. Disk Related Commands - fdisk, mount, umount, cd, mkdir, ls
  8. Process Control - killall

  1. Introduction

    This pages steps you through transferring files between two PC computers through an ethernet crossover cable. Any other ethernet connection can also be used.

    Before stepping through this guide, create a zip, tar.gz, or other archive of the data that you want transferred. Place the file in the root directory of drive of your choice.

    Be sure that the BIOS in each computer is set to boot from the CD first.

    This guide has been tested using the PLoP Linux Rescue CD version 3.3.1. Any Rescue Boot CD or floppy can be used if it has the commands listed in the above reference section.

    All the keystrokes that you sould type in at the command prompt are in green.

    Special keys such as the Escape key are represented in brackets like this: [Esc]

  2. Hardware Setup

    With the two computers powered off, connect them together with a crossover patch cable (RJ45 connectors) or with a router/switch/hub and two RJ45 patch cables.
  3. Boot Linux Rescue CDs

    If you do not have Linux installed on the machines, you will need to burn a PLoP Linux CD for each computer. These can be burned with cdrecord to write the ISO image.

    Power on each machine and insert the CDs while they are just starting to boot up.

    As Linux boots it will display all the stuff it's setting up and configuring, unlike Windows which does most all the same stuff but hides it all.

  4. Linux Harddisk Organization

    Linux assigns names to disks and partitions in a much more logical, but different way, than windows does. Windows assigns letters to the primary partitions first and then to extended partitions. If you have a variety of primary and extended partitions, this can make for a jumbled up set of drive letters. Linux on the other hand, assigns names to each of the IDE drives connected to the mainboard as follows:

         IDE0, Master:  /dev/hda
         IDE0, Slave:   /dev/hdb
    
         IDE1, Master:  /dev/hdc
         IDE1, Slave:   /dev/hdd
    
         SCSI ID0:      /dev/sda
         SCSI ID1:      /dev/sdb
    

    Partitions are then assigned numbers in order as follows:

         First primary partition of hda:   /dev/hda1
         Second primary partition of hda:  /dev/hda2
         Third primary partition of hda:   /dev/hda3
         Fourth primary partition of hda:  /dev/hda4
         First extended partition of hda:  /dev/hda5
    
  5. Source Machine Setup

    This is the machine you want to transfer the files from.

    After it is booted with the PLoP CD, login as "root", following the on screen instructions.

    Run these commands:

    1. drnet.sh
    2. ifconfig
    3. vi /etc/proftpd.conf
    4. /DefaultRooti#[Esc]oRootLogin on[Esc]:wq
    5. killall -s SIGHUP proftpd
    6. fdisk -l /dev/hda
    7. mount -o ro /dev/hda1 /mnt
    8. mount
    9. cd /mnt
    10. ls (To see if this is the correct partition to mount)
    11. cd ; umount /mnt (Only do this if it is the wrong partition and you need to umount the current one and try a different one.)
    12. md5sum backup_file.zip
  6. Destination Machine Setup

    This is the machine you want to transfer files to, such as a laptop.

    After it is booted with the PLoP CD, login as "root", following the on screen instructions.

    Run these commands:

    1. drnet.sh
    2. ifconfig
    3. ifconfig eth0 192.168.0.10 netmask 255.255.255.10
    4. ifconfig
    5. fdisk -l /dev/hda
    6. mount /dev/hda1 /mnt
    7. mount
    8. cd /mnt
    9. ls
    10. mkdir backup
    11. cd backup
  7. Make the Transfer!

    Now that both machine are configured, you can finally transfer your file. Continuing on the laptop, type these commands:

    1. ftp 192.168.0.250
    2. [Enter][Enter]
    3. cd /mnt
    4. ls
    5. get backup_file.zip
    6. bye
    7. ls -l
    8. md5sum backup_file.zip (Compare with checksum string on other computer to verify transfer integrity)
    9. cd
    10. umount /mnt
    11. [Ctrl]-[Alt]-[Del]
    12. After the machine shuts down and begins to reboot, remove the CD.
    13. Remove the ethernet cable(s).
  8. Source Machine Shutdown

    As was done on the laptop, do the following on the desktop machine:

    1. cd
    2. umount /mnt
    3. [Ctrl]-[Alt]-[Del]
    4. After the machine shuts down and begins to reboot, remove the CD.

When I have time, I'll add more explaination to each step so that a newbie could at least make a little sense out of this. Please drop me a quick email if this helps or if you have comments.