|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
backup fdisk partitions
Hi again,
I would like to backup my drive with Vista in it, because I want to get rid of it and use my new thinkpad for openbsd only. But I still want to backup what came with it. Since all my attempts using ThinkVintage failed, I'm thinking of copying the whole disk, or at least the three partitions that came with the laptop. They are three HPFS/QNX/AUX partitions. How can I backup everything so that if I wanted to I could copy back all of it into the disk and have it as "new"? Is dd an option? What's the best way to do this, and using less space space? tks |
|
|||
then I could use Puppy Linux from a usb thumb to do the job?
What if I use dd? Is it possible to gzip the resulting file? How much compression would I get? |
|
||||
I understand Puppy Linux can be installed on a USB drive. If you can boot from a USB mass storage device, than, yes, you could use it that way.
The output from dd or from ntfsclone can be futher compressed. How much is data dependent, of course. Examples: Using dd to back up partition "i" on wd0 to a server on your network, from OpenBSD: # dd if=/dev/rwd0i bs=10m | gzip | ssh backup@server.gosha.net "cat > sd0i.dd.gz" Using ntfsclone to back up /dev/hda1 to the same server, from Linux: # ntfsclone -s -o - /dev/hda1 | gzip | ssh backup@server.gosha.net "cat > hda1.ntfs.gz"
|
|
|||
Using dd(1) could be a viable solution, gzip/bzip2 would likely be capable of compressing the file considerably.. but it would take time.
If you have a 30GB partition, with 5GB used.. the compressed image would likely be smaller then 5GB, because most of it would be 0's. If you do plan to use dd(1), make sure you use a larger block size.. and raw device nodes.. otherwise it'll be unbelievably slow. Good luck. |
|
|||
thanks a lot, all very usefull
I think I'll go and try dd first |
|
|||
well... I was trying to dd the whole disk with dd if=/dev/sd0 ...
I booted the bsd install bsd.rd, and was thinking of doing it from there, but it does not have gzip. I think it would be better to gzip before sending, because this machine is faster, and I don't know how long it would take to send 250g even though the computers are in the same room... |
|
||||
That should be dd if=/dev/rsd0c ...
bsd.rd is not required. Boot in single user mode; the root partition will be read/only, and no other partitions will be mounted. Mount what you need (such as /usr) read/only, then run your command. |
|
|||
tks
and then I should mount read-only /usr to get gzip and ssh, right? Also, if I write count=1 I will save the partition table, right? |
|
||||
I'd written, above:
Quote:
Code:
$ ldd `which ssh` /usr/bin/ssh: Start End Type Open Ref GrpRef Name 1c000000 3c018000 exe 1 0 0 /usr/bin/ssh 08269000 2826e000 rlib 0 1 0 /usr/lib/libgssapi.so.5.0 058b0000 258c0000 rlib 0 1 0 /usr/lib/libkrb5.so.17.0 0a0e0000 2a120000 rlib 0 1 0 /usr/lib/libcrypto.so.18.0 0ac9d000 2aca5000 rlib 0 1 0 /usr/lib/libz.so.4.1 0b684000 2b689000 rlib 0 1 0 /usr/lib/libdes.so.9.0 0f7bc000 2f7f5000 rlib 0 1 0 /usr/lib/libc.so.51.0 030ab000 030ab000 rtld 0 1 0 /usr/libexec/ld.so $ ldd `which gzip` /usr/bin/gzip: Start End Type Open Ref GrpRef Name 1c000000 3c005000 exe 1 0 0 /usr/bin/gzip 0a49e000 2a4a6000 rlib 0 1 0 /usr/lib/libz.so.4.1 07c65000 27c9e000 rlib 0 1 0 /usr/lib/libc.so.51.0 02399000 02399000 rtld 0 1 0 /usr/libexec/ld.so $ Quote:
|
|
|||
with bs=100m I would get
dd: input buffer: Cannot allocate memory it works with bs=10, did not try other values Hopefully it will be finished overnight. |
|
|||
I do hope you meant bs=10m, because bs=10 would be 10 bytes.. smaller then the default of 512.
If you did bs=10 instead of bs=10m, it will take a VERY long time. |
|
|||
yes it was 10m, it took 5 hours for a 250g drive with a final .gz file of 43.8g.
jggimi: how do I backup the partition table with fdisk? Is it the -u option? But hasn't dd if=/dev/rsd0c saved the whole of it, including partition table etc? In that case I should not need any more backing up, right? |
|
|||
The partition table is within the MBR, the MBR is the first sector on the disk... a sector is 512 bytes.
You do have a copy of the partiton table if you used rsd0c, but you can always make another that's separate from the compressed image. $ sudo dd if=/dev/rsd0c of=mbr.bin bs=512 count=1 You can also just save the output from fdisk if you ONLY want the partition table. # fdisk sd0 > pt.txt Glad it worked out for you. |
|
||||
The dd example from BSDfan666, will copy the first sector, which includes the primary MBR. But, as I mentioned above, it will not copy any extended partition tables.
BSDfan666's example of backing up the MBR with fdisk saves the primary and all extended partitions in text format. The restoration is done manually. To back up primary and any extended MBRs, just back up the first track: # dd if=/dev/rsd0c of=mbr.backup count=63 |
|
|||
thanks a lot to both of you, it was all very helpful, and I finally start to understand a bit more about partition tables.
Now I might give FreeBSD a try, although, I'm quite used to OpenBSD and would like to stick to it. But the ram issue and some ports I'd like push me away. |
|
||||
Quote:
|
|
||||
You are correct, and I wrote misleading information, above. Extended partition tables are located within extended partitions, and would not be located within the first track. There may be one or more of these, chained recursively.
The first track on the drive contains the MBR and may also include programmatic information, such as a multiboot loader. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fdisk Question | Crotalus | FreeBSD Installation and Upgrading | 2 | 10th February 2010 08:10 AM |
backup freeBSD 7.0 using Backup Exec | ccc | FreeBSD General | 2 | 25th April 2009 09:23 PM |
fdisk -B does not rewrite the mbr | kasse | NetBSD General | 0 | 25th November 2008 11:07 PM |
fdisk can't see (Vista) ntfs partitions | caesius | FreeBSD General | 7 | 23rd September 2008 01:01 AM |
FreeBSD equivalent of DOS's fdisk /mbr | Nobber | FreeBSD General | 5 | 3rd June 2008 07:19 AM |