Raid 1 ( mirror ) afther install

I installed a opensuse 11 .

Now i installed everything , but i want to make a duplicate of the harddisk. I tried for dd , but this makes a sector copy and my suse install is on a 160gb sata and the duplicate i want on a 64Gb SSD .
The install on the 160gb disk is a 20gb partition so it fits on a 64Gb SSD. But ather cloning with dd and then booting from SSD i get:
Waiting for device /dev/disk/by-id/ata-WDC-WD1600BEVT…

So it wants the original WD160gb harddisk :frowning:

I thought then do it with yast and do a software mirror but as far as i can find this isn’t possible.

How can i clone my 20gb partition to my 64Gb SSD?

Yes you can, but you’ll have to change the copy of /boot/grub/device.map on the SSD to point to the new device.

(hd0) /dev/disk/by-id/<whatever>

You may also need to change the root= line in /boot/grub/menu.lst as well (here’s mine, yours is likely different because I’m using LVM).

title Desktop -- openSUSE 11.2 - 2.6.31.5-0.1
    root (hd0,0)
    kernel /vmlinuz-2.6.31.5-0.1-desktop **root=/dev/mapper/system-root** resume=/dev/system/swap splash=silent quiet showopts vga=0x31a
    initrd /initrd-2.6.31.5-0.1-desktop

But how do i know the device id of the SSD ?

You’ll have to boot the system with both drives attached and look in /dev/disk/by-id. I really don’t know of any other way.

If you know which sata port the SSD is plugged into, you could probably use the /dev/disk/by-path/<whatever> instead.

On my motherboard (yours may be different):


/dev/disk/by-path/pci-0000:00:1f.2-scsi-**0:0:0:0** = sata port 0 (sda)
/dev/disk/by-path/pci-0000:00:1f.2-scsi-**1:0:0:0** = sata port 1 (sdb)
/dev/disk/by-path/pci-0000:00:1f.2-scsi-**2:0:0:0** = sata port 2 (sdc)
/dev/disk/by-path/pci-0000:00:1f.2-scsi-**3:0:0:0** = stat port 3 (sdd)

In any case, these are just symlinks to the actual /dev/sd<whatever>, so if you’re not sure, check which device it’s pointing to.

If you’ve done a byte copy, you need to reinstall GRUB so it can load the disk blocks occupied by it’s stage 2, which knows how to read the filesystems. It is possible to do this from Live CD, I just did today on a trashed install, but it’s not a procedure I can explain simply.

If you have no luck, then simply make a new FS on the SSD, mount it, and then use ‘rsync -Sax / /mnt’, then add an entry in your current /boot/grub/menu.list to boot kernel and root from the SSD.

Once you have the SSD running as / and /boot, then you can use YaST to install GRUB into it, very simply.