Guard Against Data Loss with Mondo Rescue
Imagine that your hard drives happen to be wiped, deliberately or accidentally. Or, imagine that you want to clone your existing operating system. In either case, you want to run in Nuke Mode. After booting from your Mondo CD, type nuke, press Enter and watch the show. That's it.
If you want to see exactly what Mondo is doing while it is restoring, press Alt-A and type
tail -f /tmp/mondo-restore.log
to monitor its progress in detail.
If you want to restore only some files, or if you do not want to prep/format your drives, then you should boot into interactive mode. Type interactive and then press Enter at boot time. You will be asked to say yes/no to a range of questions: do you want to partition your devices? Do you want to format them? Do you want to restore everything? Do you want to restore something? Do you want to run LILO to set up your boot sectors?
Interactive mode is for people who have lost a subset of data from their live filesystem or perhaps who have lost some data from their latest backup and want to restore a subset of data from an earlier backup.
When you have backed up your system, booted from the CD in compare mode and verified the archives, you are in a position to experiment with your system. You could move partitions around, resize them, enable or disable RAID, play with other boot loaders, etc. That is what Mondo is really good for. The greatest threat to a typical Linux installation, in my opinion, is a careless root user.
If you want to try some of these tricks, boot from your Mondo CD and choose expert mode. This will drop you to a shell prompt. Edit the mountlist file. Then, type mondo-restore and choose Interactively from the pop-up menu. The mountlist is a text file, /tmp/mountlist.txt, located on the RAM disk after you boot from the Mondo CD. It lists the various partitions that will be created, their sizes, their mountpoints and their formats. To change the size or layout of your partitions, just edit that file with pico /tmp/mountlist.txt (or use your favorite editor). Save and close by pressing Ctrl-X and then Enter.
Here is a sample mountlist. The sizes are in kilobytes, so count the zeros carefully when modifying the values. Remember, the new layout will not take effect until you run mondo-restore to repartition and reformat the drives:
/dev/hda1 /mnt/windows vfat 4096000 /dev/hda2 swap swap 256 /dev/hda3 / ext2 8192000
To change the root partition's size and format, simply alter the relevant fields:
/dev/hda1 /mnt/windows vfat 4096000 /dev/hda2 swap swap 256 /dev/hda3 / reiserfs 16384000Or, you could move from using multiple primaries to using a primary partition (hda1), an extended partition (hda2, created/handled by Mondo) and several logical partitions. Note the new /dev/hdaN entries:
/dev/hda1 /mnt/windows vfat 4096000 /dev/hda5 swap swap 256 /dev/hda6 / reiserfs 8123000 /dev/hda7 /usr reiserfs 4099000 /dev/hda8 /home reiserfs 4099000If you have added a second hard drive (e.g., primary slave) then you could move some of your partitions to that drive. See below and note the changes:
/dev/hda1 /mnt/windows vfat 4096000 /dev/hda2 swap swap 256 /dev/hda3 / reiserfs 81422000 /dev/hdb1 /home reiserfs 9481000 /dev/hdb5 /usr reiserfs 16384000 /dev/hdb6 /tmp reiserfs 1589000It is slightly more complicated to move to RAID because you have to create an /etc/raidtab file. You can do this from within Expert Mode. Just type pico /etc/raidtab and create a good raidtab file. (That is beyond the scope of this article.) Then, replace the conventional device with a RAID device (/dev/mdN):
/dev/hda1 /mnt/windows vfat 4096000 /dev/hda5 swap swap 256 /dev/md0 / reiserfs 16384000After editing the mountlist, run mondo-restore. When asked if you want to partition and format the drives, say yes. You may want to restore the data or run LILO to initialize the boot sector, depending on what you are doing. If you are simply testing a new partition layout, you probably want to say no when answering the other questions. Otherwise, say yes.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Tech Tip: Really Simple HTTP Server with Python
- Doing for User Space What We Did for Kernel Space
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
- SuperTuxKart 0.9.2 Released