LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2004, 06:32 PM   #1
dgermann
Member
 
Registered: Aug 2004
Distribution: Ubuntu 8.04.1 desk; Red Hat 9.0 server
Posts: 331

Rep: Reputation: 30
Question Backing up to external HDD?


Hi--

Let's say I'd like to do my backups to a removable HDD, and keep the copy as quick and easy to restore as possible.

(I just went through trying to restore one directory from a mamoth .tgz file, and it has been very slow, indeed. So I think I want to have files that are unarchived and unzipped. Just copy and go. If that does not make sense, please tell me why.)

So what commands or programs would I best use, keeping in mind that I want to keep intact all ownerships and permissions on all files? What are the exact commands to use, keeping in mind I am still wet behind the ears on linux.

Would I use dd? cpio? afio? a disk image program like http://www.partimage.org/ ?
 
Old 08-27-2004, 06:56 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
I would use tar.

eg.
Code:
tar c /foo | tar Cvx /backup/of/
 
Old 08-27-2004, 08:33 PM   #3
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,509

Rep: Reputation: 46
That's interesting... I have myself tried a bunch of backup techniques. One which is very interesting, if you wanna have fast access to data is to make an iso file. Then you can mount the iso file to any dir and access data (mount -o loop /iso-to-be-mounted /mountpoint). This way you can have all data in only one file. Just like a huge targz. But to my experience, access to an iso file is faster than targz when it comes to >1GB files.

If you have enough room, just copy dirs raw. Do some research on the "synchronize" features some file managers have. Krusader can synchronize, I guess. Using a sync program you can mirror entire dir threes in a blink.

And: Partimage can be used from a System Rescue CD, which is very good and a small iso download (~100MB). Google for it.

Last edited by bruno buys; 08-27-2004 at 08:34 PM.
 
Old 08-27-2004, 09:17 PM   #4
dgermann
Member
 
Registered: Aug 2004
Distribution: Ubuntu 8.04.1 desk; Red Hat 9.0 server
Posts: 331

Original Poster
Rep: Reputation: 30
ToniT--

Thanks. The tar for me turned out to be a lot of work and time for restores. Plus, I hear they are a potential problem in that if one part of the archive is bad, it can prevent access to uncorrupted parts.

So that's why it seems to me that backups via some straight copy technique is a good idea.

Why do you like the idea of tar instead?

bruno buys--

Thanks for the multiple ideas.

Let me see if I understand:

First, I am not sure how to make an iso file. Is that what Partimage does? It talks about making an image of a partition, but I don't know if that includes the data in the partition....

Second, I don't know what you mean by "synchronize features." Is there an app that does that?

Third, what is Krusader? I do not find it on my drive using locate.

Finally, I have heard of system rescue CDs. My idea of that would be a disk that takes an image of the whole drive and then when something goes kaflooey, you just wipe the drive and restore the image to its pristeen condition before the problem. Right? Anywhere close?

I like the idea of a raw copy as you suggest. I used cpio to transfer stuff to my second internal HDD when I installed it, and to a removable hard drive, and so far as I can tell all permissions and ownerships went along with it....

Thank you both for your help. I really needed to hear from you.
 
Old 08-27-2004, 10:30 PM   #5
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,509

Rep: Reputation: 46
Hi friend!
*****
First, I am not sure how to make an iso file. Is that what Partimage does? It talks about making an image of a partition, but I don't know if that includes the data in the partition....

Partimage uses mkisofs to make an iso image of the partition (including data on it). You can use mkisofs yourself at the cli. mkisofs is quite standard in every distro and its very easy to use. Just "rpm -q mkisofs" to see if you have it.
*********

Second, I don't know what you mean by "synchronize features." Is there an app that does that?

To synchronize dirs is to pick any two dirs (you choose) and make them clones of each other. Its just copying files and sub-dirs, but you don't have to do manually. A sync-enabled program will check for the existence of the file and copy if necessary, as well as sub-dirs and also check for the newest ones. In the end, you have two identical dirs. Its very good for backing up.

The winSCP3 ssh client for win can sync a remote linux host. Very nice, I use it a lot at work to sync with my linux computer at home.

In win, there's total commander, former windows commander. Syncs nicely.
*********
Third, what is Krusader? I do not find it on my drive using locate.

Krusader isn't default. Here you can see it: http://krusader.sourceforge.net/
*******

Finally, I have heard of system rescue CDs. My idea of that would be a disk that takes an image of the whole drive and then when something goes kaflooey, you just wipe the drive and restore the image to its pristeen condition before the problem. Right? Anywhere close?

Right. If done correctly, you can backup a partition with a boot sector, and restore it perfectly.
Sysresccd is actually, a linux distro, aimed at maintenance. The guys are very good. Sysresc rocks, at making partitions, running fsck against damaged filesystem and stuff. Its got even qtparted, a GNU partitioner! The point is, you don't have to install anything or edit your system. sysresc is bootable and lots easier to run than to cope with deps, install things, unmount devices, build backups, etc...
http://www.sysresccd.org

Obs - Also, sysresc can burn the image file to a cdr(w) drive.
*******
I like the idea of a raw copy as you suggest. I used cpio to transfer stuff to my second internal HDD when I installed it, and to a removable hard drive, and so far as I can tell all permissions and ownerships went along with it....

I'm not sure if it failed due to some cpio internals, or filesystem problem. The filesystem you backed up to was fat, by any chance? fat systems can't hold file permissions.

To do this you can use the dd command, which is to me, one of the commands worthy to know detailed operation. dd is great. With dd you can do

dd if=/dev/hda1 of=/my-backup-place

where "if" means input file and "of" is output file.

also, dd can copy an entire floppy to an image file by doing

dd if=/dev/fd0 of=/dev/hdaX/somedir/somefile
******

I went sort of wild, backing up things here, after my seagate crashed badly. Now I got five backup partitions and a script that builds a mamoth tgz (like you say) and saves five copies of it in diff partitions. No surprises, anymore.

Post again if you wish. If you find something new about backing up, please let me know!

********

Last edited by bruno buys; 08-27-2004 at 10:39 PM.
 
Old 08-27-2004, 10:48 PM   #6
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
I have been misinterpreted here...

If you read closely enough, you see I wasn't using tar to make tar.gz packages, but to copy files from one location to an other by piping all the data through. Why copy files with tar? It keeps all the date and attribute information and it is network transparent (can be used together with netcat or ssh). Nice alternative to cp, cpio, dd and friends.
 
Old 08-27-2004, 11:31 PM   #7
dgermann
Member
 
Registered: Aug 2004
Distribution: Ubuntu 8.04.1 desk; Red Hat 9.0 server
Posts: 331

Original Poster
Rep: Reputation: 30
bruno buys--

Yup, I did a locate and found /usr/bin/mkisofs. So I could learn something about it and see. Does it save to a regular file or to a CD? The man file looks a little intimidating.

<<You can use mkisofs yourself at the cli

What's a cli?

As far as mammoth .tgz files, I think I am done. I have broken my script file for the cron job down to make two separate backups (as .tgz), one of the system stuff, and a second of the data. May just break the system stuff down into a couple different files, too, to keep them small. Lightweight is easier to search and restore. And not all my eggs in one basket....

Thanks, bruno buys!

ToniT--

Ahh, I see that now! Sorry to have misquoted you.

Why do you like tar over cpio, for example, or dd?
 
Old 08-28-2004, 12:19 AM   #8
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,509

Rep: Reputation: 46
*******
So I could learn something about it and see. Does it save to a regular file or to a CD?

It saves to a file. If you wanna burn it, you can burn as an image, and have all file system under it completely kept.

You can also mount the file into a dir of your choice. If you want to see how it works, do this:

Pick one .iso file like a linux distro, anyone would do. Then mount it:

mount -o loop linux.iso /home/dgermann/mountiso/

This will give you access to the dirs and files inside the iso, see? Its read-only, though.
Someone started a thread asking how to mount them read-write, but i dont know if he succeeded.

This way you can keep backup files of your data, access them and burn cd's. You can remove old ones and build new ones, but you can't (to my knowledge) edit these files.
**********

What's a cli?

Sorry friend. This is lingo for a Command-Line-Interface, as opposing to a Guided-User-Interface. Its the console.

********

As far as mammoth .tgz files, I think I am done. I have broken my script file for the cron job down to make two separate backups (as .tgz), one of the system stuff, and a second of the data. May just break the system stuff down into a couple different files, too, to keep them small. Lightweight is easier to search and restore. And not all my eggs in one basket....

Yes, indeed. As far as linux is concerned, its got several tools for backup already as standard available. This is very good. You can make an iso file and save it to a few diff partitions, for example.

If you have a removable device, its great for backup. I have two ide disks, so I write my files to both.

Anyway, take a look at sysresc. It might give you another good ideas about all this.



*********
 
Old 08-28-2004, 12:06 PM   #9
dgermann
Member
 
Registered: Aug 2004
Distribution: Ubuntu 8.04.1 desk; Red Hat 9.0 server
Posts: 331

Original Poster
Rep: Reputation: 30
bruno buys--

Wonderful help you are giving me bruno buys! Thank you!

It occurs to me that some of my frustration is coming from the wealth of ways to do something in linux--tar, cpio, dd, afio, .iso, sysresc, for example--and choosing among them is like deciding from 39 ice cream flavors. I need to remember that I can come back to the ice cream stand again later.

Then again, I could have one scoop of cpio and one of .iso both in the same cone (cron job), and have double protection....

Thanks for the great tutorial and hand-holding, bruno buys!
 
Old 08-28-2004, 01:19 PM   #10
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,509

Rep: Reputation: 46
Glad I could help! Cheers, Doug!

One last thing: In my kde, there's a menu Sync, under Utilities. Its got some synchronizing tools for mobiles, palms, and laptops. This KFS thing is supposed to sync websites, but I guess it can be used for dirs.
 
Old 08-30-2004, 12:10 PM   #11
dgermann
Member
 
Registered: Aug 2004
Distribution: Ubuntu 8.04.1 desk; Red Hat 9.0 server
Posts: 331

Original Poster
Rep: Reputation: 30
Thanks, bruno buys!

You are a real help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual boot XP(internal IDE HDD) Debian(external USB-IDE HDD) using boot.ini PolarDog Linux - Laptop and Netbook 2 07-01-2005 10:50 PM
External HDD Help jorasmi Slackware 1 05-09-2005 11:36 PM
Bootable partion on external HDD? 40 gb firelight hdd. Trebile34 Linux - Hardware 1 03-14-2005 12:50 PM
Getting an USB external HDD xiongnu Mandriva 1 12-12-2004 09:11 PM
10.1 and external HDD skadub Mandriva 0 10-23-2004 07:36 AM


All times are GMT -5. The time now is 12:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration