Backup & restore hd with haiku-/beos-partitions

hi there.

this question might be silly, but i was’nt able to find a solution for my problem yet:
i want to change the hd in my ibm x31 and so i need backup/restore.
i’ve tried:

  • using the haiku installer and copying the two partitions to external usb-drive
  • cloning the partitions via my mac, external usb-drive and images
    but no luck so far. i’m not able to generate a new, bootable drive :frowning:

thank you!

You aren’t getting the MBR by copying partitions manually, you’d probably be better off using the data dumper command:

dd if=/source_drive of=/destination_drive bs=8M

if it works the same in Haiku as it does in Linux… a cursor will blink for a long bit until the duplicating is done. you want to be sure of the drive assignments because if you get them backwards you’ll be blanking your source drive.

  • Generate new partions on the new harddisk
  • Run haiku from cd or usb and start the installer
  • open DriveSetup (in the installer) and initialize BFS file system to the new partiotions.
    ! Make the system partition bootable (in the installer)
  • mount the old harddisk and copy the files to the new harddisk

http://besly.de/menu/search/archiv/sys/haiku_installation_eng.html

You can restore the MBR using writembr, and the PBR of the system partition using makebootable. Also make sure to mark the system partition as active.

hi wildman

and thank you! i think this is what the mac os x disk tools doing under the bonnet, too.
i’m going to try it directly in haiku. but is it working for partititions only, or for complete drives?

best regards,
jan

hi lelldorin.

i’ve found your link last night and tried this procedure, too.
the strange thing is, that is working with the drive attached as external usb-drive, but not in the internal drive-bay.
i’m afraid the cmos battery is out of order – the x31 can’t hold the date.
it would be a strange coincidence, but perhaps this is the real reason for my fail?

best regards,
jan

hi pulkomandy.

thank you. unfortunately i have no real experiences with bios, mbr and pbr as »native« mac-user –
how to apply this command when i’m not able to boot the partition or drive itself?
this is the point i just did’nt understand in the articles i’ve found so far?

best!
jan

hi wildman

and thank you! i think this is what the mac os x disk tools doing under the bonnet, too.
i’m going to try it directly in haiku. but is it working for partititions only, or for complete drives?

best regards,
jan[/quote]

This will work with complete drives

hi munchhausen

and sorry for asking this silly question, but is the right syntax for copying the 2 internal partititions to the new, external drive?
dd if=/dev/disk/ata/0 of=/dev/disk/usb/0 bs=8M
(have no backup, so it should be safe :wink:

thank you!
jan

Hmm not 100% sure about USB disks (i.e. whether the USB disk would be bootable afterwards?). But in theory, yes. If you want to take a backup though you can just do:

dd if=/dev/disk/ata/0 of=/some/path/to/usb/newbackupfile.image bs=8M

And then to restore do:

dd if=/path/to/newbackupfile.image of=/dev/disk/ata/0 bs=8M

So the newbackup.file is the file to create, and the path for it is just the path to your USB drive. Then restoring goes the other way around, so “if” (which means input file) is set to the newbackupfile.image and “of” (output file) is set to the disk node (replace /dev/disk/ata/0 with whatever disk you are restoring back to).

BTW, I wanted to check you had the right dev node name, but couldn’t find any docs for block device node naming on haiku (I’ve never actually done the above on haiku, only *nix, and don’t have haiku booted to have a look). Perhaps someone can enlighten us? Was also wondering why there are separate “raw” nodes for partitions (or are there for whole disks also) - what is the difference to the other nodes?

hi munchausen

and thanks a lot for your detailed help! i’ve spent some hours again, but unfortunately without much luck …

i’m taking the drive out of the usb-housing for booting, but i was able to boot via usb with the original/old drive only

[quote]dd if=/dev/disk/ata/0 of=/some/path/to/usb/newbackupfile.image bs=8M
And then to restore do:
dd if=/path/to/newbackupfile.image of=/dev/disk/ata/0 bs=8M[/quote]
ah, the trick is to go via an image-file? i’ve tried it directly, from disk to disk (like »dd if=/dev/sda of=/dev/sdb« in the linux-world).
with the exception of some kernel panics the copying works well, but the results are different:

  • finished dd with success, but system crashes on opening the usb-drive afterwards
  • or finished with success, but the partitions are much smaller after reboot?!

this is exactly my problem, too. there a lot of good articles for different linux-flavors, but i can’t figure out the haiku-syntax for devices?
for example: »df -a« told me there is »/dev/disk/usb/0/0/0« but –
dd: failed to open ‘/dev/disk/usb/0/0/0/haiku.img’: Not a directory
dd: failed to open ‘/dev/disk/usb/0/0/haiku.img’: Read-only file system
dd: failed to open ‘/dev/disk/usb/0/haiku.img’: Read-only file system
dd: failed to open ‘/dev/disk/usb/haiku.img’: Read-only file system

so far the most »successful« way was to use the installer and copy the old to the new partititions – the new drive seems to be perfect, but he can’t boot (bios logo, blank screen, endless loop …)

thank you for patience :slight_smile:

To work with whole drives you need to use raw suffix ex:

dd if=/dev/disk/ata/0/master/0/raw of=/dev/disk/usb/o/o/raw bs=XM
(where X is the number you choose)

just use the tab completion to get the right paths.

Bye.

This is the easiest thing to do with Haiku.

1 Install the new disk along side of the old disk.

2 Boot haiku as usual

3 Run the installer from your haiku install and install to the new disk

4 Boot off of the new disk. All of your files are copied by Insaller to the new disk including the files in /boot/home

enjoy!

Ah, for writing to an image you need to mount the disk and put the mount point before the image name, e.g. /usb_disk/haiku.img, instead of /dev/disk/usb/0/0/haiku.img etc.

In terms of doing it using the installer, to make the disk bootable afterwards you just need to run makebootable and/or install the boot manager. For makebootable you just mount the drive and run “makebootable /mountpoint”. For the boot manager, you can find it in /system/apps/bootmanager and use the gui to install it.

… sorry for the delay – lot of work, birthday and other stuff :wink:
after some errors this command is working!(!)

dd if=/dev/disk/ata/0/master/raw of=/dev/disk/usb/0/0/raw bs=8M

the x31 is able to boot from the new usb-drive. the next step is to put the drive into the bay,
but later more :wink:

thanks a lot to all, i’ve learned a lot in this thread.

yes, i’ve tried this first and copying was working. but i was’nt able to boot from this copy …

[quote=bbjimmy]This is the easiest thing to do with Haiku.

1 Install the new disk along side of the old disk.

2 Boot haiku as usual

3 Run the installer from your haiku install and install to the new disk

4 Boot off of the new disk. All of your files are copied by Insaller to the new disk including the files in /boot/home

enjoy![/quote]

… mission accomplished(!) unfortunately i can’t tell exactly which detail helped at the end? :wink:
and a big bonus: the beos-partitition is booting, too. (after the last haiku-update only haiku was able to boot …)
so everything’s fine, but i hope i don’t need a new restore soon :slight_smile:

thank you all and best regards,
jan