Tuesday, December 24, 2019

14.04 - Install Ubuntu from Ubuntu without reboot



I have an empty harddrive and am already running Ubuntu Trusty Tar 14.04.3 LTS (originally 14.04 and regularly upgraded). I would like to install the same version on the empty harddrive but without rebooting (many things running right now). Is there a package that can be installed that will install Ubuntu on another harddrive? I would like to avoid this long procedure for 12.04 (I am installing 14.04.3) described by an answer here and do it direct without setting up a virtual machine as suggested by the other answer there.



You can clone the drive you are using onto the other one. It takes a long time possibly a day or two if you have a large drive but it is very simple to do. The procedure assumes the hardware is very similar or in the best case the same.



You most likely have two drives listed in your /dev directory. This can change depending on hardware but /dev/sda is the most common. If you look there is probably a /dev/sda1 and /dev/sda2 or more /dev/sda# devices. These are your partitions on the drive. Then if the other drive is empty you will have a /dev/sdb but no /dev/sdb# devices. It's critical that you understand which drive is which since this procedure will copy one drive to the other and doing it backwards will destroy all your data. With all changes to file systems I suggest you backup your data before you start.




For this example I'm going to assume /dev/sda is your primary drive and /dev/sdb is the second drive you want Ubuntu on. You can use a tool called dd to copy the drive byte for byte.



Basic format is this: dd if=/dev/sda of=/dev/sdb bs=2M



"if" is your input file
"of" is your output file and what you will over write
"bs" is block size. Default is 512 but you can speed it up by increasing it. I usually use 2M.



The command will have no output till it's done but your hard drive will start spinning at near max until it's done. After wards you should be able to swap the secondary drive into the primary drive's place and boot. If you want a dual boot system this is not the solution for you.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...