Thank you very much Peter. I really appreciate the extra
effort taken in preparing the long explanation.
It is just to easy to get confused since the backup shows
it is processing /boot but then as you point out it actually
skips /boot if your using dump.... but not if your using
tar.
As for me, a long explanation is always preferred as short
explanations tend to assume to much. Usually this means
Linux knowledge I don't have so the more thorough the
explanation the better :)
Thanks again Peter,
Darrell
-----Original Message-----
From: Peter Samuel
To: Darrell May
Cc: 'Edward Kuhn'; e-smith developers info mailing list
Sent: 2/20/01 8:58 AM
Subject: RE: [e-smith-devinfo] backup of extra drives
On Tue, 20 Feb 2001, Darrell May wrote:
> Hi Peter, guess it is time for your wisdom to educate
> this newbie. I was under the impression that if you
> mount a file system it becomes a part of / and since
> flexbackup is set to backup / it would pick this new
> file system up during a backup. For instance if I perform
> a backup of / as shown below in the standard flexbackup.conf
> I also process /boot in the same backup. Backup instance
> number 2 simply does a backup of /boot by itself.
WARNING Long explanation follows. Skip to last 2 paragraphs for the
quick
explanation :)
Welcome to Unix 101:
--------------------
Everything in Unix is a file. Everything. There are different types of
file, but they are all files.
The fundamental particle of a filesystem is the inode. Every file in a
filesystem is associted with an inode. Every inode in a filesystem is
unique to the filesystem. Every inode in another filesystem is unique
to that filesystem. The inode holds information about:
- file type - directory, file, block device, char device, pipe,
socket etc
- creation time
- modification time
- access time
- permissions
- owner
- group
- disk blocks that make up the file
- indirect disk blocks containing lists of disk blocks that make up
the file
- indirect disk blocks containing indirect disk blocks containing
lists of disk blocks that make up the file
- anything else the file system needs
note, the inode does NOT contain the name of the file. That is the job
of the directory. A directory is simply a table of inodes and names.
Given those fundamental details, what happens when you mount a
filesystem?
The first filesystem that must be mounted is the root filesystem. It
contains a bunch of files and directories. Subsequent filesystems can
now be mounted onto any of the directories in the root filesystem.
A typical e-smith system has 2 filesystems mounted (we'll ignore the
/proc filesystem as it is a virtual filesystem containing hooks into
the kernel. It is still a filesystem in that it has all the filesystem
semantics, it just not associated with any physical storage device).
The 2 disk filesystems in a typical e-smith system are / and /boot.
df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda6 9527208 314776 8728476 4% /
/dev/hda1 15522 2541 12180 18% /boot
There are different physical devices associated with the
filesystems.
Let's look at the inodes of these directories:
ls -lid / /boot
2 drwxr-xr-x 17 root root 4096 Feb 19 19:13 /
2 drwxr-xr-x 3 root root 1024 Feb 19 19:13 /boot
Both of them have the same inode of 2! That's OK because they are
different file systems. Let's look at a different system with more
filesystems mounted (it's actually our new server which I'm in the
process of building)
df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/rd/c0d0p5 1035660 296728 686324 31% /
/dev/rd/c0d0p1 15522 6154 8567 42% /boot
/dev/rd/c0d0p7 8238432 32600 7787344 1% /var
/dev/rd/c0d1p1 10325748 15988 9785240 1% /home
/dev/rd/c0d2p1 20572080 3452 19523604 1%
/home/e-smith/files/users
/dev/rd/c0d2p2 20572112 9951328 9575756 51%
/home/e-smith/files/ibays/library
/dev/rd/c0d2p3 20572112 36 19527048 1%
/home/e-smith/files/ibays/development
/dev/rd/c0d2p4 20580144 36 19534680 1%
/home/e-smith/files/ibays/mirrors
Each filesystem is associated with a different physical device.
ls -lid / /boot /var /home /home/e-smith/files/users \
/home/e-smith/files/ibays/library
/home/e-smith/files/ibays/development \
/home/e-smith/files/ibays/mirrors
2 drwxr-xr-x 21 root root 4096 Feb 15 18:06 /
2 drwxr-xr-x 3 root root 1024 Feb 15 18:06 /boot
2 drwxr-xr-x 7 root root 4096 Feb 15 11:19 /home
2 drwxr-xr-x 6 root root 4096 Feb 15 15:14
/home/e-smith/files/ibays/development
2 drwxr-xr-x 7 root root 4096 Feb 16 12:34
/home/e-smith/files/ibays/library
2 drwxr-xr-x 6 root root 4096 Feb 15 15:14
/home/e-smith/files/ibays/mirrors
2 drwxr-xr-x 42 root root 4096 Feb 16 12:13 /home/e-smith/files/users
2 drwxr-xr-x 20 root root 4096 Feb 15 17:23 /var
All of these directories have the same inode, but they belong to
different filesystems.
By default, e-smith uses the dump program to backup file systems. Dump
is special in that it understands the internals of the ext2
filesystem. It knows that when it is looking at the / filesystem that
/boot/System.map is part of a different filesystem so it doesn't
backup the stuff in /boot. You can even use dump to backup and
unmounted filesystem.
If you use a program like tar, which doesn't understand filesystem
internals but simply relies on directory hierarchies, then it will
simply backup everything it sees without knowing what filesystem the
file is associated with.
--
Regards
Peter
----------
Peter Samuel [EMAIL PROTECTED]
http://www.e-smith.org (development) http://www.e-smith.com
(corporate)
Phone: +1 613 368 4398 Fax: +1 613 564 7739
e-smith, inc. 1500-150 Metcalfe St, Ottawa, ON K2P 1P1 Canada
"If you kill all your unhappy customers, you'll only have happy ones
left"