Skip to main content
Home
The Baheyeldin Dynasty
The journey for wisdom starts with knowledge
  • Home
  • About
  • Site Map
  • Contact

Ubuntu Linux backup of a laptop using a USB enclosure and the dump utility

  1. Home

By Khalid on 2007/02/04 - 19:23, last updated 2007/02/04 - 19:23

Earlier, I wrote about how to use a USB 2.0 hard disk drive enclosure for backup.

In this article, I explain how to use that hard disk using the dump utility.

The dump utility

The dump utility is one of the oldest commands for backup on UNIX system, but not one that is widely used in home and small business Linux systems.

In a nutshell, the dump utility works on the file system level, and can handle incremental backups. By incremental backups, I mean that only files that have changed since the last lower level backup will be included. This has the benefit of backing up only the changes to a system, and consumes less time and space than a full backup.

The dump utility does this by "levels". Level zero means full backup. Level 1 means all files changed since the last level 0 backup was performed. Level 2 means files changed since the last Level 1 or 0 was performed, and so on until level 9.

For example, one would perform a level 0 backup every week on Sunday, and a level 1 every day until the following Sunday. Other schemes are possible, for example Towers of Hanoi plan.

Caution: Quiescent file system recommended

It should be noted that backup should be performed on a quiescent file system with no activity on it. Ideally, the file system should be unmounted to ensure that the data in it is not being changed.

Installation of dump

Note that each file system type has a different dump program. The default dump program works for the ext2 and ext3 file systems, and that is what I will cover in this article. Other file systems such as ReiserFS or XFS have their own dump with a similar syntax.

To From the command line using a root shell, do the following:

aptitude install dump 

Now you have the programs that are needed for backup.

Performing a dump

This script performs a level 0 backup (full) on the root file system:

#!/bin/sh
DIR=/media/extdisk0
DATE=`date +%Y-%m-%d`
FILE=full-$DATE.dump

dump -0 -u -b 64 -f $DIR/$FILE /

To perform a level 1 backup, you can use the command:

dump -1 -u -b 64 -f /media/extdisk0/dump-1.dump 

Dump is quite verbose and outputs useful information like estimated time to complete, size of data backed up, and time it took to backup.

Here is a sample from a level 0 dump:

  DUMP: Date of this level 0 dump: Sun Jan 28 02:39:53 2007
DUMP: Dumping /dev/sda6 (/) to /media/extdisk1/backup/backup-l0-2007-01-28.dump
DUMP: Label: none
DUMP: Writing 64 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 22545911 blocks.
DUMP: Volume 1 started with block 1 at: Sun Jan 28 02:41:20 2007
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: 18.66% done at 14021 kB/s, finished in 0:21
DUMP: 45.57% done at 17122 kB/s, finished in 0:11
DUMP: 73.43% done at 18395 kB/s, finished in 0:05
DUMP: 96.73% done at 18173 kB/s, finished in 0:00
DUMP: Closing /media/extdisk1/backup/backup-l0-2007-01-28.dump
DUMP: Volume 1 completed at: Sun Jan 28 03:01:55 2007
DUMP: Volume 1 22512512 blocks (21984.88MB)
DUMP: Volume 1 took 0:20:35
DUMP: Volume 1 transfer rate: 18228 kB/s
DUMP: 22512512 blocks (21984.88MB) on 1 volume(s)
DUMP: finished in 1235 seconds, throughput 18228 kBytes/sec
DUMP: Date of this level 0 dump: Sun Jan 28 02:39:53 2007
DUMP: Date this dump completed: Sun Jan 28 03:01:55 2007
DUMP: Average transfer rate: 18228 kB/s
DUMP: DUMP IS DONE

And here is a sample from a level 1 dump:

  DUMP: Date of this level 1 dump: Sat Feb  3 02:03:05 2007
DUMP: Date of last level 0 dump: Sun Jan 28 02:39:53 2007
DUMP: Dumping /dev/sda6 (/) to /media/extdisk1/backup/backup-Sat.dump
DUMP: Label: none
DUMP: Writing 64 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 385410 blocks.
DUMP: Volume 1 started with block 1 at: Sat Feb 3 02:05:32 2007
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: Closing /media/extdisk1/backup/backup-Sat.dump
DUMP: Volume 1 completed at: Sat Feb 3 02:06:22 2007
DUMP: Volume 1 383616 blocks (374.62MB)
DUMP: Volume 1 took 0:00:50
DUMP: Volume 1 transfer rate: 7672 kB/s
DUMP: 383616 blocks (374.62MB) on 1 volume(s)
DUMP: finished in 50 seconds, throughput 7672 kBytes/sec
DUMP: Date of this level 1 dump: Sat Feb 3 02:03:05 2007
DUMP: Date this dump completed: Sat Feb 3 02:06:22 2007
DUMP: Average transfer rate: 7672 kB/s
DUMP: DUMP IS DONE

Using the Restore command

For restoring a backup, another command is needed, aptly called restore.

To list the contents of a backup file, use this command:

restore -t -f /media/extdisk0/full-2007-02-01.dump 

To actually restore the data in the backup file do the following:

Create a fresh file system:

mkfs -t ext3 /dev/sda1 

Restore the data:

restore -r -f /media/extdisk0/full-2007-02-01.dump 

There are other options to restore, for example -C compares the contents of files from a backup to what is on the file system.

Resources

  • Hard disk USB 2.0 enclosure for backup under Linux.
  • How To use dump for backup.
Contents: 
Linux
  • Add comment

Current

Pandemic

  • COVID-19
  • Coronavirus

Search

Site map

Contents

  • Family
    • Khalid
    • Ancestry
    • Extended
  • Friends
  • Nokat نكت
  • Writings
    • Cooking
    • Culture
    • Science
    • History
    • Linguistics
    • Media
    • Literature
    • Politics
    • Humor
    • Terrorism
    • Business
    • Philosophy
    • Religion
    • Children
  • Technology
    • Linux
    • Arabization
    • Drupal
      • Association
    • Software
    • Internet
    • Technology in Society
    • Digital Archeology
    • NCR History
    • MidEast Internet
    • Programming
    • Saudi ISPs
    • Miscellaneous
  • Places
    • Canada
      • Weather
    • Egypt
      • Cuisine
      • Alexandria
      • E.G.C.
    • USA
    • Saudi Arabia
  • Interests
    • Astronomy
    • Fishing
    • Photography
    • Snorkeling
    • Nature
    • Photomicroscopy
  • Miscellany

In Depth

  • al-Hakim bi Amr Allah: Fatimid Caliph of Egypt الحاكم بأمر الله
  • Alexandria, Egypt
  • Arabic on the Internet
  • Articles on the history of Muslims and Arabs in the Iberian Peninsula تاريخ المسلمين و العرب في الأند
  • DIY GOTO Telescope Controller With Autoguiding and Periodic Error Correction
  • E.G.C. English Girls College in Alexandria, Egypt
  • Egyptian Cuisine, Food and Recipes مأكولات مصرية
  • George Saliba: Seeking the Origins of Modern Science?
  • Internet Scams and Fraud
  • Mistaken for an Arab or Muslim: Absurdities of being a victim in the War on Terror
  • Mistaken Identity: How some people confuse my site for others
  • One People's Terrorist Is Another People's Freedom Fighter
  • Overview of Google's Technologies
  • Photomicroscopy
  • Pseudoscience: Lots of it around ...
  • Resources for using Google Adsense with Drupal
  • Rockwood Conservation Area, Southern Ontario
  • Selected Symbolic Novels And Movies
  • Snorkeling the Red Sea near Jeddah
  • Updates and Thoughts on the Egyptian Revolution of 2011

Recent Content

Most recent articles on the site.

  • Origin Of COVID-19: Natural Spillover, Lab Leak Or Biological Weapon?
  • Kamal Salibi and the "Israel from Yemen" theory
  • How To Upgrade HomeAssistant Core In A Python Venv Using uv
  • Ancestry - Paternal Side
  • Review of Wait Water Saver For Whole House Humidifiers
more

Most Comments

Most commented on articles ...

  • Another scam via Craigslist: offering more than asking price
  • Warning to female tourists thinking of marrying Egyptians
  • Craigslist classified for used car: Cheque fraud scam
  • Winning the lottery scam email: World Cup South African lottery
  • Email Scam: BMW 5 Series car and lottery winning
more

About Khalid

Various little bits of information ...

  • Khalid Baheyeldin: brief biography
  • Presentations and Talks
  • Youtube Videos
  • GitHub Projects
  • Drupal.org Profile
  • Astrophotography @ Flickr

Sponsored Links

Your Link Ad Here

Tags

Android Mobile Ubuntu Sony OnStep OpenWRT Router Ericsson COVID-19 Rogers Coronavirus Arabic Kubuntu Home Assistant GSM Telescope tablet Spectrum Scam Python 419 Laptop Firefox DIY CPU Conspiracy Comet Balkanization backup App
More

© Copyright 1999-2025 The Baheyeldin Dynasty. All rights reserved.
You can use our content under the Terms of Use.
Please read our privacy policy before you post any information on this site.
All posted articles and comments are copyright by their owner, and reflect their own views and opinions, which may not necessarily be consistent with the views and opinions of the owners of The Baheyeldin Dynasty.

Web site developed by 2bits.com Inc.