LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-22-2012, 10:55 PM   #1
shakira19
Member
 
Registered: Sep 2012
Posts: 34

Rep: Reputation: Disabled
grub2


hi,

I'd like to copy my system into a new hard drive, with dd. What do I have to do next to be able to boot on that new hard drive ?

Do I need to update grub, and how ?

Thanks
 
Old 10-23-2012, 01:09 AM   #2
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 331

Rep: Reputation: 59
If you have copied the entire drive image to a larger/equal size drive ("dd if=/dev/sda of=/dev/sdb") you should not need to do anything except go to the bios setup and make sure the new drive is first in the boot order. The MBR would have been copied as well. The newer linux distros use uuid to identify a drive so you would not need to make any changes in /etc/fstab. If you are going to leave the old drive connected, you would need to change the uuid's & partition names with "tune2fs" on the original drive.


Regards,
Stefan
 
Old 10-23-2012, 01:42 AM   #3
shakira19
Member
 
Registered: Sep 2012
Posts: 34

Original Poster
Rep: Reputation: Disabled
Thanks for that info, it however leads me to give further details that I thought were irrelevant. I won't be able to copy the entire disk, just part of it, because the newer disk (ssd) is smaller. Nevertheless, the older disk is partioned into several parts, and the one where the system resides (/) (there's no extra partition for /home or swap or whatever, the other partitions are just ntfs data) is indeed smaller than the newer disk (the system in the old disk is in /dev/sda1, and takes 30 GB, whilst the newer disk has 240 GB).

So with that in mind, do I need to do something as far as grub/fstab are concerned, once dd has been issued ?
 
Old 10-23-2012, 03:11 AM   #4
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 331

Rep: Reputation: 59
The easiest way (in terms of not having to re-install grub) is to use a tool such as gparted to resize the original drive using a live cd. Maybe remove the data partitions and resize the root partition if required so that it is smaller than the SSD. Do a direct copy with dd after the resize. This worked well for me although it would be a good idea to backup any important data / settings on the drive.

The other option which I have not personally done is to use rsync or tar to copy the data, then use chroot to install grub to the MBR of the new drive. Have a look at this.

The 3rd option (if you are using a debian based system) is to get a list of installed programs with "dpkg --get-selections", do a new install, then use dpkg --set-selections to create the same environment. Lastly copy over the contents of you home folder and any specific configuration files in /etc such as network/interfaces, sources.list etc.

Code:
dpkg --get-selections > mypackages.txt
sudo dpkg --set-selections < mypackages.txt
sudo apt-get dselect-upgrade
Regards,
Stefan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help on Grub2 rng Linux - General 2 07-30-2012 09:39 AM
kcm-grub2 - No valid GRUB2/BURG installation could be detected cristi92b Linux - Newbie 2 06-14-2012 09:01 AM
Need help with GRUB2 MoonlitSky1031 Linux - Laptop and Netbook 3 09-22-2011 03:57 AM
[SOLVED] GRUB2 after a minor update of GRUB2 /boot prefix no longer needed?? wikapuki Linux - Software 1 10-24-2010 03:39 PM
grub2 psmurthy Linux - Newbie 2 03-16-2010 12:20 PM


All times are GMT -5. The time now is 02:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration