BrainDump
  Home arrow BrainDump arrow Page 5 - Rescue Me!
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Forums Sitemap 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
BRAINDUMP

Rescue Me!
By: Peter Lavin
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 36
    2005-01-18


    Table of Contents:
  • Rescue Me!
  • Creating a Bootable Diskette
  • Booting From a Legacy Device
  • Mounting a Drive
  • Copying Files

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Rescue Me! - Copying Files
    (Page 5 of 5 )

    If you’re here to salvage some files by copying them to a diskette then you will also need to know how to mount and format a floppy. You’ll be able to format your diskette for DOS or for Linux by first typing fdformat /dev/ fd0H1440. To make a Linux floppy type then type, mke2fs /dev/fd0 or, alternately, mkdosfs /dev/fd0 for a DOS diskette. To copy files to your floppy you will again have to mount the drive. This can be done in exactly the same way that any other drive is mounted. First create a mount point, let’s create one called “floppy”, and then mount the drive by typing mount –t msdos /dev/fd0 /mnt/floppy. Just drop the file type switch (–t msdos) if you are mounting a Linux floppy. We’re now ready to copy files.

    Copying files is identical regardless of the operating system. You simply use the cp command specifying a source and destination. For instance, to copy the file fstab in the etc directory to your floppy you would simply type cp /etc/fstab /mnt/floppy/fstab. If you wish to copy a directory and all its contents then you will need to know the -r switch. The “r” stands for recursive and will copy all files and directories within the directory specified.

    In this way you can salvage as many files as needed from the hard drive. Read on for more advanced commands.

    Advanced Commands

    In some cases you may want to run as root on your original Linux partition. This can be done by creating a mount point for the file system, mounting it and then using the chroot command. This is exactly what I wanted to do so that I could make a boot disk for my Red Hat 7.1 installation.

    First I created a mount point for the file system. In my case I knew that my Linux drive was device hda5 so I created a mount point called “rh71”, mounted this device and then simply typed the command chroot /mnt/rh71. I next changed my directory to the sbin directory, typed ./mkbootdisk --device /dev/fd0 2.4.2-2 and inserted a floppy into the drive. The number following the device is the kernel version number of my distribution. You don’t have to remember it--you can easily look it up by examining the files in the “boot” directory.

    When I was finished I changed back to tomsrtbt by typing exit at the command line.

    In very quick order, I had a boot disk for my Red Hat installation. I could now boot into Linux and do anything else I needed to do using X Windows.

    Things don’t always work out so nicely though. Sometimes you may need to look at or change information in a file. In this case you will have to use the text editor vi. I’ll give you some quick tips on using this editor.

    To invoke vi, type vi and pressing Enter. If there is a specific file that you wish to edit, type the name of the file after the command vi. Upon start-up, vi is in command mode and you need to press i for “insert” if you wish to add to or change the file. Saving your changes is done by returning to command mode by hitting the Esc key, followed by :wq. This is not an extended tutorial on using vi, so if you have made mistakes and want to abandon what you’ve done you may quickly exit by pressing the escape key and then :q!. None of your changes will have been saved.

    There are many more useful commands available--for checking the integrity of the file system, for instance--but you would probably do well to learn a little more about Linux before exploring them. You don’t want to accidentally reformat your drive!

    Conclusion

    The “tomsrtbt” distribution is a nice little tool if you have trouble booting from your hard drive and don’t have a rescue disk. Using a few basic Linux commands, files can be examined, copied or changed regardless of what operating system you are running.



     
     
    >>> More BrainDump Articles          >>> More By Peter Lavin
     

       

    BRAINDUMP ARTICLES

    - iPad Developers Flock To SDK 3.2
    - Managing a Linux Wireless Access Point
    - Maintaining a Linux Wireless Access Point
    - Securing a Linux Wireless Access Point
    - Configuring a Linux Wireless Access Point
    - Building a Linux Wireless Access Point
    - Migrating Oracle to PostgreSQL with Enterpri...
    - Demystifying SELinux on Kernel 2.6
    - Yahoo and Microsoft Create Ad Partnership
    - The Advantages of Obscure Open Source Browse...
    - Dell Announces CSI-style Digital Forensics S...
    - Milepost GCC Speeds Open-Source Development
    - Learn These 10 Programming Languages
    - Tomcat Capacity Planning
    - Internal and External Performance Tuning wit...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek