BrainDump
  Home arrow BrainDump arrow Page 5 - Rescue Me!
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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? 
BRAINDUMP

Rescue Me!
By: Peter Lavin
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 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:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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

    Dell PowerEdge Servers

    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.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Ever hear of <a href="http://www.knoppix.net">Knoppix?</a> It's pretty much...
       · I think the article is out of date. Better methods of system recovery now exist such...
       · There is a free online book...
       · The URL link to Knowing Knoppix did not work. It can be found at...
       · Better is in the eye of the beholder. There are many ways to skin a cat, this...
     

       

    BRAINDUMP ARTICLES

    - Outsourcing: the Hoopla, the Reality
    - MySQL Plays in the Sun
    - All About SQL Functions
    - SQL: Functioning in the Real World
    - More Advanced SQL Statements
    - Beginning SQL the SEQUEL: Working with Advan...
    - Beginning SQL
    - A Look at the VI Editor
    - A Quick Tour of Boo
    - Book Review: Open Source Licensing
    - PGP and GPG: Email for the Practical Parano...
    - Microsoft Continues War on Open Source
    - Secure Remote Desktop Sharing with VNC on Li...
    - A Look at Google Project Hosting
    - What we can Learn from Two Linux vs. Microso...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway