The procedure would be something like this:Ġ) Make a backup of the partition table (print out fdisk data using p and save it to a file). If your data fits inside the smaller disk, then one option is to resize the filesystem on the larger disk. (I have done this before for example with boot partitions from iso images). If however you are only interested in data stored in the first part of the disk - for example the boot / root partition, this may well be okay to do. This may be a problem if there is any data on the last areas of the disk, additionally the filesystem data will be incorrect on the copy of the disk. If you did this the dd / cat will only copy the size of the target filesystem from the source. Including the blank regions of the filesystem. dd / cat copies from the start to the end. The problem basically is that the data isn't stored in the first part of the disk necessarily. No this isn't okay to do, you will lose data if you do it. An answer from July 2017 using Ubuntu 14.04 Install/LiveCD In my particular case, I opted to leave the 750 HDD in as a secondary drive that I mount by UUID in the fstab under /mnt for backups and data collection. It is so fast you won't even get a full draw from the coffee mug before it is asking for your password. If you do this with a SSD like I just did, put on your seatbelt before booting. It will eject the CD then prompt you to press enter so it can flush the remaining buffers.Īnd voila, it can now boot onto the smaller drive just fine, because the size of the partitions allowed it to fit. Make sure to do a clean shutdown of the liveCD. (It will take the same length of time as before - a couple of hours) Then proceed with the dd: dd if=/dev/sdb of=/dev/sda If it does, you can wipe the MBR and partition table from it with the following command: sudo dd if=/dev/urandom of=/dev/sdb bs=512 count=24 To verify that the 160 GB (/dev/sda) has no partition table. Open a terminal window and check things out: sudo fdisk -l (/dev/sdc is the LiveCD I am booting from) The original /dev/sdb is still plugged into the same motherboard SATA socket as before, so now I plug the SSD into SATA port 0, and the SSD is now /dev/sda The new SSD is also a 160 GB ($50 on eBay) so it is large enough to hold the partitions. It still contains just the original 160 GB partitions from before I have not used more of the 750 GB drive. Say your boot drive fails, or you decide to replace it with a 160 GB SSD drive like I just did. THEN LATER - AND MORE TO THE POINT OF YOUR QUESTION: That causes my system to boot from the first hard drive it finds, which is the 750 on SATA port 2.īut in your case, you are removing the 750 and setting it aside as the backup, thus setting the stage to answer your question specifically. In my case, I then removed the original boot drive and set it aside as the backup. I am writing this 3 years after you posted the question and mine takes 8000 seconds (about 2.5 hours) to do the backup. Proceed to back up your boot drive to the larger one: sudo dd if=/dev/sda of=/dev/sdb It will appear as if it was a new, blank drive. Which will wipe the MBR and partition tables guaranteed. If /dev/sdb shows partitions but you want to use it anyway, you can wipe the MBR and partition table from it with the following command: sudo dd if=/dev/urandom of=/dev/sdb bs=512 count=24 Then ideally, it will show that /dev/sdb has no partition table. dev/sda is your original 160 GB drive with partitions. dev/sdb (750 GB drive) is plugged into SATA port 2 dev/sda (160GB boot drive) is plugged into SATA port 0 You might be doing this simply for backup. Here is an over-simplified answer, where I either never used gparted to resize the partition, or I did but now have done it again to bring it back down to size.įor instance, if you take a 160 GB drive (/dev/sda) and copy it to a 750 GB drive (/dev/sdb) - which I did to get faster booting on a 7200 rpm drive. (Note that all the below should be done by booting your original installation DVD and using the LiveCD option so the drives in question are not mounted.) Yes, as long as the partitions will fit so do not need to be resized by dd.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |