LinuxQuestions.org
Visit Jeremy's Blog.
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 03-18-2006, 02:40 PM   #1
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
Backuping up a Reiser4 partition with "dd"...


I have a 13GB Reiser4 partition that has only 4GB of data on it. I want to make an image of the partition with "dd", but I don't want to backup the empty space on the drive, how is this possible? Does a tree rebuild with fsck.reiser4 move all of the files to the beginning of the partition?
 
Old 03-19-2006, 07:07 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well you either want to back up all the files, OR you want to image the partition... i assume you mostly don't want to waste the space? just compress the dd output:
Code:
dd if=/dev/hdb1 | gzip -9 > /var/images/hdb1.gz
 
Old 03-19-2006, 05:39 PM   #3
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Original Poster
Rep: Reputation: 30
Yes, I was considering that, but I don't necessarily want the partition to be 13GB when restored.
 
Old 03-20-2006, 06:25 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
@acid_kewpie Assuming it isn't the root partition of the file system wouldn't it be better to do
Code:
dd if=/dev/zero of=/file/on/partition/in/question bs=512
rm -f /file/on/partition/in/question
to optimize the ensuing compression?

Last edited by JZL240I-U; 03-20-2006 at 06:28 AM.
 
Old 03-20-2006, 06:49 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i wouldn't have thought so... dd is IO intensive, gzip is cpu intensive. A such you can use both resources to get the job done in a single run wihtout much more time being taken. infact, it could even be quicker to do it this way as it will take less time to write the compressed image than the uncompressed one, so you may save time over all, and get the end result you want.
 
Old 03-20-2006, 06:54 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Yes, sounds plausible that it is quicker. I was thinking of the compression-rate. After all, gzip would compress all the garbage of his entire 9 GB unused space. If that is levelled to a huge zero , shouldn't it compress that much more "tightly"?
 
  


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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM

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

All times are GMT -5. The time now is 10:13 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