Copying from /dev/sda to /dev/sdb
I have two scsi disks; exact in size and make. On sda there's a dual boot system - Windows XP, and Linux (debian).
Windows is expanding; with 4G free space. I want to transfer Linux to sdb; and let Windows do its thing. I partitioned sdb, using Partition Magic; and I made the partition sizes a little greater than their corresponding ones on sda. I created the file system on sdb with KNOPPIX 4.0. I first tried "cp -pr /dev/sda2 /dev/sdb1" [sda1 is NTFS] and got "'/dev/sda2 ->' /dev/sdb1". If the copy command won't do it what will? I had tried dd in the past, and got the error that there was no more space left on the device. |
Can you please elaborate on the result of the cp? It really should
have worked (you could try -a instead). Cheers, Tink |
You don't say what brand of SCSI disk it is, but most new IDE disks come with a software CD from the factory or utilities available for download from the manufacturer's website. This software allows such things such as partitioning and copying a partition from the old disk to the new disk. It does not care what the contents of the partition are. If your new SCSI drive came with a similar CD or you can find the utilities on the web, I would use those tools instead.
|
haha, hey guys -- no big deal, you just copied one device and overwrote another....
you need to mount the filesystems and copy all the files. i.e. Code:
mkdir -p /mnt/sda1 && mkdir -p /mnt/sdb1 Code:
umount /mnt/sda1 && umount /mnt/sdb1 good luck! |
Here is what I usually would do when duplicating my install to my spare drive. First boot with knoppix 2 to get to a console root prompt then,
Code:
mount /dev/sda2 /mnt/sda2 |
ps. problem with the dd command is that using it will create identical partitions
Code:
dd if=/dev/sda1 of=/dev/sdb1 you can use dd, then resize the partition on sdb1, but this can get tricky. |
Since the partitions sizes aren't the same, copying a partition would not work. To use a partition as source/target, they must have the exactly same size.
You need to use a mount point as source and target. Mount /dev/sda2 as /mnt/source and /dev/sdb1 as /mnt/target and "cp -pr /mnt/source /mnt/target" will work just fine. Of course, you need to create a filesystem on /dev/sdb1 first. This filesystem can be different than the one on /dev/sda2. |
I created partitions on /sdb that are equal in size to those on /sda.
I created a filesystem on each partition of /sdb. After having cd'd into each /sda mount point, I copied data using 'cp ./* mnt/sdb_'. As I see it, what I need to do next is: 1.Edit /etc/fstab 2.Modify /etc/lilo.conf to reflect where root is on /sdb 3. Reboot, and expect the best. Correct???? |
Quote:
1) The boot loader on /dev/sda must be not changed or overwriten by windows. 2) If the boot manager is lilo them the MBR must be updated to reflect the new boot dir. (lilo -v) A working live CD would be valuable if anything goes wrong. And don't delete the linux on /dev/sda before you are sure your system is working right on the new location. Keep copies of the original /etc/lilo.conf and /etc/fstab just in case. good luck ! |
All times are GMT -5. The time now is 10:57 AM. |