![]() |
| | #1 |
| Registered User Join Date: Dec 2006
Posts: 1,780
| Backing up recovery partition The recovery partition is ~10GB. I usually wouldn't mind having that sitting on my harddrive... but it's a 80GB SSD, and space is scarce. Just to make sure, can I back it up using dd like this? (assuming the SSD is at /dev/sda, and the recovery partition /dev/sda1) Code: dd if=/dev/sda of=partition_table skip=446 count=64 dd if=/dev/sda1 of=recovery_partition bs=4M Master boot record - Wikipedia, the free encyclopedia and to restore Code: dd if=partition_table seek=446 count=64 #reboot dd if=recovery_partition of=/dev/sda1 bs=4M |
| cyberfish is offline | |
| | #2 |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,941
| If your question is, can I use "dd" to copy an entire file system the answer is yes. Probably you want to make sure the block size is the same but it looks like you are on top of that. Using an offset works too, I've used this to place a filesystem after a compressed kernel on a floppy, since the kernel can boot itself, then the kernel finds the filesystem using the offset. You can compress the resulting file, etc too. OH! And remember you want to keep a copy of the windows boot sector!
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS Last edited by MK27; 07-08-2009 at 09:17 AM. |
| MK27 is online now | |
| | #3 |
| Registered User Join Date: Dec 2006
Posts: 1,780
| Ah yes, I have used dd for partition backup. But I'm unsure about the partition table part. Is it necessarily to keep the Windows boot sector? I thought they are all the same and can be easily had by doing a repair from a Windows installation disk (I have a Vista disk). EDIT: but true, I could also back it up while I am at it. It's just 446 bytes. Last edited by cyberfish; 07-09-2009 at 06:51 AM. |
| cyberfish is offline | |
| | #4 |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,941
| Hmmm, so it's contiguous with the partition table? I think when I have done this before I have just backed up a single chunk, probably 500 bytes, but I don't remember clearly...I definitely have put it back and had it work tho, but that was probably old copies of XP or Win 95.
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS |
| MK27 is online now | |
| | #5 |
| Chinese pâté Join Date: Jul 2007 Location: Canada
Posts: 406
| Here's two way to save your primary partition table :
Also, I think most versions of dd consider a block size of 512 bytes by default; you should always specify it with the "bs=" option to be safe.
__________________ I hate real numbers. |
| foxman is offline | |
| | #6 |
| Jaxom's & Imriel's Dad Join Date: Aug 2006 Location: Alabama
Posts: 801
| Dude, you are showing your age here. . . This is no longer the case, and has not been the case for many years. I think that ended some time in the 1.34.x era, but I cannot recall. |
| Kennedy is offline | |
| | #7 |
| Registered User Join Date: Dec 2006
Posts: 1,780
| Yeah, apparently the 512 bytes MBR is 446 bytes boot code + 64 bytes partition table + 2 bytes padding according to wikipedia. |
| cyberfish is offline | |
| | #8 |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,941
| Well, I sure did it a few times with 2.1+ kernels. I have such a floppy in my closet somewhere, I could check it just to be sure but I believe there is no bootloader or anything, just a compressed kernel written with a pointer to the root device and the offset where the filesystem begins. Maybe there is a bootloader...hmmm. Much the same anyway, and you can certainly still do that (raw image is grub + fs w/ kernel), altho using floppies may be a too tight a squeeze
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS Last edited by MK27; 07-10-2009 at 10:04 AM. |
| MK27 is online now | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Disk Partition Stuff | CodeMonkey | Tech Board | 15 | 12-19-2008 11:53 AM |
| Partition Problem | anirban | Tech Board | 1 | 09-30-2007 03:32 AM |
| Reading a (possibly EXT2) partition with Windows | nickname_changed | Linux Programming | 5 | 08-20-2003 07:43 PM |
| Linux/Windows partition | Fyodorox | A Brief History of Cprogramming.com | 11 | 04-24-2002 08:16 AM |
| hardware interaction in c | vineetwadwekar | C Programming | 6 | 03-29-2002 09:01 AM |