Re: Backing up my settings and files - noob alert :)

From: Moe Trin (ibuprofin_at_painkiller.example.tld)
Date: 01/31/05


Date: Sun, 30 Jan 2005 20:27:28 -0600

In article <pan.2005.01.31.00.30.00.104908@nowhere.lan>, Leythos wrote:

>Now that I've moved to FC3 and find that I can do about 80% of all my work
>and having had to wipe/reinstall after the 2.6.10-1.741 kernel update I
>find that I need to know how to backup my data in case it happens again.

This is just a play box for you, right? I would assume that a "work"
box would get the general 'back up everything' treatment.

Our 'work' systems have the "system" files on one disk, and this doesn't
change very often. We use a central authentication mechanism (so the
/etc/passwd and /etc/shadow files are not critical), and ALL user home
directories are on central file servers. Thus, we have what amounts to
be an 'install image' on one of the servers. When we build new hardware,
we simply boot using a floppy, connect to the file server, and pour the
install right in. We then edit a few files like /etc/sysconfig/network,
/etc/hosts, and /etc/sysconfig/network-scripts/ifcfg-eth0 so that "this"
hostname and address are there, and we're done. (For security reasons,
we don't run dynamic addressing/hostnames - _everything_ is statically
addressed/configured.) Updates are run as a cron job in the middle of
the night, and the image file is updated at the same general time. The
'user' home directories are backed up nightly off the file server, and
that leaves only minor configuration files that need backup. As these
rarely change, we basically do a 'find / -newer last.update.timestamp
-exec ls -lad {} \;' to find all files that have changed since the last
update. A restore is then just popping the image on, and then copying
those incremental backups back onto the system.

You are probably in need of some understanding of what/where files are.
You say you just got the system back up, so here are a number of things
I'd suggest doing.

1. rpm -Va > files.that.changed
2. find / -ctime -10 -exec ls -lad {} \; > more.files.2.look.at

For read access, you'll have to run both those commands as root. The first
one uses the package manager to see what files that the package manager
knows about have changed. See the man page for 'rpm' under 'VERIFICATION'
for an explanation of the output. Now, here's a point to ponder:

[compton ~]$ rpm -Vf /etc/passwd
S.5....T c /etc/hosts.allow
S.5....T c /etc/hosts.deny
S.5....T c /etc/profile
..?..... c /etc/securetty
S.5....T c /etc/services
[compton ~]$

Here, I told rpm to verify the package that "contains" /etc/passwd. Now I'm
sure you'll agree that the distributor couldn't possibly know what users I
have here, yet /etc/passwd doesn't show up as an altered file. (The question
mark flag in /etc/securetty is because I ran the command as me, and I don't
have permission to read that file.)

This is why you run the second command above. The 'find' looks for stuff that
has had something that changes the 'ctime' (any change that would change the
directory entry) starting at the top of the file system. In both of these
commands, you probably want to ignore the /proc/ (imaginary file system)
and /dev tree. Again, see the man page for 'find'.

>I logon as a user, run Evolution with Exchange 2000 server connection, no
>POP connections, PAN, OO Documents, etc... Can I just burn my home folder
>to a DVD and expect to be able to restore it with all my settings on
>another machine?

That depends. Probably, this would work, but there could be 'ownership'
problems, and depending on how you "call" filenames (below), you may be
missing some. UNIX systems actually keep track of ownership by UID numbers,
and these are translated to usernames via entries in /etc/passwd. For
example:

[compton ~]$ ls -ln 113673
-rw------- 1 824 13 1586 Jan 30 17:44 113673
[compton ~]$ stat 113673
  File: "113673"
  Size: 1586 Filetype: Regular File
  Mode: (0600/-rw-------) Uid: ( 824/ibuprofin) Gid: ( 13/ news)
Device: 3,0 Inode: 22037 Links: 1
Access: Sun Jan 30 18:38:32 2005(00000.00:15:16)
Modify: Sun Jan 30 17:44:29 2005(00000.01:09:19)
Change: Sun Jan 30 17:44:29 2005(00000.01:09:19)
[compton ~]$ id
uid=824(ibuprofin) gid=100(users) groups=100(users)
[compton ~]$ grep 824 /etc/passwd
ibuprofin:x:824:100:Moe Trin:/ibuprofin:/bin/bash
[compton ~]$

here files are owned by user number 824. There is an entry in the passwd
file that has the login name 'ibuprofin' in the first field, and the user
ID '824' in the third.

There may be some files in /etc/ that are important. The /etc/ tree is
supposed to be where the system configuration files live. See the 'File
Hierarchy Standard' at http://www.pathname.com/fhs/ for a lot more info.
See also the 'Linux-Filesystem-Hierarchy' at http://tldp.org/guides.html
(although it does have some minor errors).

Don't forget that many user configuration files are 'dot files' meaning
that the name begins with a dot. These are "hidden" from the simple
directory listings (ls -l) and the '*' wildcard DOES NOT EXPAND to
include them. To see them, use 'ls -lA' (or ls -la) or use '.*' as the
wildcard. You're probable used to typing 'dir *.*' to see all files
except (pushing my DOS memories here) those with the 'System' or 'Hidden'
attribute. Try 'ls -l * .*' (notice the space) and see what that does.
You may want to pipe that to a pager like 'more' or 'less' or 'most' if
there are a lot of files.

You probably want to spend some time reading the books that are available
at the Linux Documentation Project (tldp.org/guides.html noted above).
Last I checked, there were _about_ 30 books (no idea how many pages that
would be) for free download. Then there are the HOWTOs - about 480 of them,
which total about 3.9 million words, or roughly 11,900 pages.

        Old guy



Relevant Pages

  • Re: Backing up my settings and files - noob alert :)
    ... >find that I need to know how to backup my data in case it happens again. ... we simply boot using a floppy, connect to the file server, and pour the ... you'll have to run both those commands as root. ... Access: Sun Jan 30 18:38:32 2005 ...
    (alt.os.linux.redhat)
  • Re: Backups: rsync, software RAID, other strategies?
    ... I use the following configuration on my file server. ... typical rsync that will mirror the source to the ... You can also purge the backup by removing ... >of the drives as a backup for the other. ...
    (freebsd-questions)
  • Re: LAN access while VPN is up
    ... > only do a nightly backup - mainly a bandwidth problem. ... The scheme consumes around 10GB per windoze box on the file server, ... > Is there not a Canadian law against computer tampering? ... The music industry here managed to shoot itself in the foot rather ...
    (comp.security.firewalls)
  • Re: Maxtor external hard drive no longer recognized by My Computer
    ... backup of my drive hourly to my file server, ... hardly a reason or budget for RAID. ... I got the SCSI RAID controller free with the drives ...
    (microsoft.public.windowsxp.hardware)
  • Re: Problems Backing Up
    ... commands, and when something goes wrong, you find it more difficult to hunt down the problem. ... > I didnt have time last night to continue my exploration of the BACKUP ... >> Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.server)