LinuxAnswers DiscussionThis forum is to discuss articles posted to LinuxAnswers.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
when dd copies a partition, does it also copy the super-block?
In other words, if I copied my windows partition and then restored it, could I then boot from it, assuming, of course, that my boot manager was set up correctly?
Also, could I gezip the file of the partition to make it smaller, or does that cause problems when restoring?
Also, could I gezip the file of the partition to make it smaller, or does that cause problems when restoring?
I know there's got to be a way to do that manually, maybe even piped into one line. Clonezilla has that kind of functionality except with an easy to follow menu to get it all done. Wonderfull tool.
Heck, it might be as easy as $ dd if=/somefile | tar -czvf /compresed_image
bs=446 count=1 is way to backup the MBR, but not the partition table, so yes, it can be less than 512.
bs=4096 - When copying large amounts, say, backing up a partition, bs=4096 tends to be the best choice for faster, more modern machines so I hear.
You can indeed compress on the fly, via piping. For example, here's the command I recently used to backup one of my partitions:
dd if=/dev/sda1 bs=4096 | bzip2 > OSXsda1_ddbackup.bz2
I don't know anything about conv= stuff...I haven't read the review yet, but still wanted to answer so of your questions.
DrCR
_______________
A5N8X, 3500+ single-core Manchester, 2x512MB Corsair XMS, MSI 7600GT
S-12 430W, HR-05, Scythe Mime, VF900 modded with Scythe 80x25mm. Dual D12SL-12 Yate Loons
WD1200JB, WD3200JB, HD501LJ
Dual, independant WinXP installs via Grub hiding, VectorLinux 5.1.1SOHO, 5.8SOHO.
- - -
MacBook Pro Santa Rosa, 2.2GHz, 250GB Scorpio, Ceramique compound, Pending Appled-Tux Logo mod
MBRed Hard Drive with: OSX, WinXP, Vista (MSDN, pending), Sidux 2007-03
Pending Fusion "bootcamp" VMs pointing to native OS installs
I am trying to mirror partitions from one harddisk to another.
At first I tried to mirror the whole harddisk to one of similar size and model.
Code:
dd if=/dev/sda of=/dev/sdb bs=4k conv=noerror 2
It managed to copy every bit correctly except for the var partition. So i cleaned up the partition table of sdb and mirror the rest manually, i.e.
Code:
dd if=/dev/sda7 of=/dev/sdb7 bs=4k conv=noerror 2
Strangely, it refuses to copy anything inside the www directory. I've tried many times with the same result - /var/www is empty in the target harddisk.
I do this all the time without any problem on Debian Etch. On this Debian Lenny box, mirroring other partitions seems fine except for /var.
Is there anything that I can trobleshoot? Logging the output showed no error encountered.
if remote share is connected as
smb://ipnumber/share
could you use just one dd piped to another
and do you need root privilleges on local and
remote machine for that?
Yeah, if you booted up from a live CD, mounted a samba share to a NAS or some such, you shouldn't have any problem dding over an image of the local hard drive or a partition on the local hard drive to the NAS.
Just bare in mind it may take a good while, even over gig-E. There was one dd-like app, irrc for Linux, but perhaps unix, that has a nice transfer status. But really all you have to do is have a rough idea of how big the backup file should be and just check out the file properties on the shamba share, occasionally refreshing, to see its progress.
jasontn, just to verify, you do have the /dev/sda7 and /dev/sdb7 unmounted, correct? Most of var is temp stuff, but iirc at least some of it sticks between boots e.g. iirc there's an Apache file in www that is used as the default webpage for an Apache install.
jasontn, just to verify, you do have the /dev/sda7 and /dev/sdb7 unmounted, correct? Most of var is temp stuff, but iirc at least some of it sticks between boots e.g. iirc there's an Apache file in www that is used as the default webpage for an Apache install.
HTH
/dev/sdb7 was not mounted when copying was done. The server was idle hence little writing activity when copying. Not a single file, not even the index.html file was copied, from the www directory. I even tried placing other files there, which was also not copied.
I have done this before on live servers, running Debian Etch, flawlessly. It is only now that I'm doing this on Deban Lenny. I don't know if this problem is OS related. Unfortunately, I don't have another machine to reproduce this.
/dev/sdb7 was not mounted when copying was done. The server was idle hence little writing activity when copying. Not a single file, not even the index.html file was copied, from the www directory. I even tried placing other files there, which was also not copied.
"little writing activity" would still result in an inconsistent image; there must be no writing activity.
"little writing activity" would still result in an inconsistent image; there must be no writing activity.
Is it safe to unmount the /var partition when the server is running? I normally schedule the copying in the middle of the night when there is no user accessing. It is only accessed by users in the same country.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.