LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-22-2014, 02:56 AM   #1
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 19.1
Posts: 298

Rep: Reputation: 41
Backing up HDD: Size question


Suppose I want to back up the entire contents of an HDD.
Method 1: Copy everything over to a second HDD. Will take up same space.
Method 2: Make a backup image which will potentially be smaller.

Question: What kind of size savings can be expected by the backup image method (method 2), and what are the cons compared to method 1?.
 
Old 09-22-2014, 03:27 AM   #2
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
You can use Method 3 as below :

Quote:
tar cfvz /your_new_hdd/backup.tar.gz <files/folders you wants to backup>
This will compress your files in single tar.gz (Just like using zip).
 
Old 09-22-2014, 04:58 AM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Compression yield a size decrease anywhere from 1:1 to 2:1.

Movies, JPG pictures and music are virtually uncompressible. They are already compressed and hold no redundancy which can be removed to compress any further. OTOH really large plain text files (like log files) could compress up to 10:1.

So it is hard to say and very dependent on the actual data contents. But todays bulk data is mostly multimedia, that is already compressed format.

The big disadvantage with compressed backups is that they usually are monolithic. If there is one error in the comressed file you loose everything. The second disadvantage is that it is harder to find a certain file and restore it.

I use rsync to backup on external hard disks or remote servers. But that is for data up to 2 TB. If you have really big data that might not suffice. But I doubt whether you want to use compressed backups for data larger than 2 TB anyway.

jlinkels
 
Old 09-22-2014, 10:11 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Well what do you want to copy? Just normal files or the whole format and structure on that hard drive? Sort of makes a bit of a difference. Plus, what types of files? If they're binaries, images, sound files, and videos; many of those may be compressed to some degree. For instance simple documents, or a bunch of code files are highly compressible. Something like a JPEG image is already compressed whereas BMP and GIF are less compressed. Not sure, there are a ton of movie formats, I'm guessing that WMV, FLV, and MP4 are compressed somewhat and maybe MPEG is a bit more able to be compressed. So, before you go crazy with one big zip, perhaps you ought to examine your data and determine whether or not compressing makes any sense. Further, compressing all the data means you have to then decompress it someday. Therefore if you make one big compressed file representing all your data, you'll need space to decompress that file in the future; this includes memory and time. I'm assuming that you may open the compressed file and pick what you wish to extract, however if there are too many files, it will take up memory just to show you the report and take you time to locate what you wish to extract. That is circular though ... some large body of data will need to be organized in some fashion where you can reference things, similarly it will be organized the same within the zip file.

Doubting this is the case, but if you need to maintain the integrity of the disk format and structure, for instance say it's your root file system, then dd would be used to create a same sized disk image. Another option on that is to do something like create a file based file system to copy all files into, then resize that file system to use the minimum space actually needed by the file system. That technique works for ext4 only, I believe.

If you want to backup normal data files, then I'd structure them all under a heirarchy and either compress or not depending on whether it buys you much added space when you do compress.
 
Old 09-22-2014, 11:35 AM   #5
wearetheborg
Member
 
Registered: Sep 2004
Distribution: Mint 19.1
Posts: 298

Original Poster
Rep: Reputation: 41
Mostly media files, so I guess the cons far outweigh the pros for compression.
rtmistler, excelltent point on the space requirement for decompressing data, I was totally missing that.
 
Old 09-22-2014, 12:40 PM   #6
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,521

Rep: Reputation: Disabled
Other options are optical media, DVDs or that new fangled one (bluray) that takes 50gb at a time.
 
Old 09-22-2014, 12:46 PM   #7
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
this is my image backup/restore process:
http://www.linuxquestions.org/questi...6/#post5146111
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about backing up dman65 Linux - Server 1 10-24-2010 01:26 AM
question about backing up data newbiesforever Linux - General 4 11-01-2009 01:37 AM
how to setup a linux server for backing up hdd from network seraphic Linux - Newbie 7 07-21-2006 07:47 AM
hdd size problem spx2 Linux - Newbie 5 01-11-2006 03:10 AM
Backing up to external HDD? dgermann Linux - Newbie 10 08-30-2004 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:14 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
Open Source Consulting | Domain Registration