Backing Up Linux / Transferring to another HDD

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Backing Up Linux / Transferring to another HDD

Postby jonburton » Sun Apr 14, 2013 1:11 pm

Hi Everyone,

I am a brand new Linux user so sorry if this is a very basic post! Ive migrated from Windows to Linux and have now got my Ubuntu 12.04LTS just as I like it with a couple of apps installed (Virtual Box, VMWare Player)

I have decided to upgrade my HDD to an SSD but dont want to reinstall everything again! Is there a way of making a full backup of my set up to a usb keyfob or an easy way to migrate it over to the new SSD

I am running on a laptop

Thanks :)
jonburton
 
Posts: 2
Joined: Fri Sep 07, 2012 12:19 pm

Postby Dutch_Master » Sun Apr 14, 2013 1:59 pm

Provided the SSD is at least equal in size to your current HDD, you can copy the entire disk using the dd command. However, you need to perform this task from a Live CD (like Knoppix), not your current installation.
Dutch_Master
LXF regular
 
Posts: 2471
Joined: Tue Mar 27, 2007 1:49 am

Postby nelz » Sun Apr 14, 2013 3:06 pm

Don't use dd to copy a hard drive's geometry to an SSD, it could give terrible performance. Repartition the drive with a recent version of Gparted, then copy the contents of each filesystem across separately.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby jonburton » Sun Apr 14, 2013 3:34 pm

Is there a way of me backing everything up to a usb stick / dvd using something like Ghost (from the windows days) and then swapping the HDD for the SSD and restore everything?
jonburton
 
Posts: 2
Joined: Fri Sep 07, 2012 12:19 pm

Postby nelz » Sun Apr 14, 2013 4:04 pm

I wouldn't use something like Ghost, although such programs are available, to transfer to an SSD, it needs to be correctly formatted from scratch. If you have a typical Ubuntu single partition plus swap setup, you could use tar, from a live distro, to backup to a stick, but you have to jump through a few hoops if it is FAT formatted (because of the 4GB file size limit). USB to SATA adaptors are cheap (so cheap that some SSD kits come with them) and make the process so much simpler as you can have both drives connected at the same time.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby glenn4uk » Wed Apr 17, 2013 6:13 pm

Jonburton,

dd will work perfectly fine to copy one drive to another. SSD makes no difference. You just have to have physical access to both drives which might be an issue on a laptop. dd will make an EXACT copy of either a whole drive or a single partiton - drive geometry is a non-issue.

You might look into Clonezilla, however. It works very much like Ghost but will work with virtually any Linux file system. It does allow you to back up a compressed copy of disk or file system for restoring after you swap drives.
glenn4uk
 
Posts: 5
Joined: Fri Nov 27, 2009 1:35 am
Location: Athens, Alabama, USA

Postby nelz » Wed Apr 17, 2013 7:35 pm

You do realise that an SSD needs to be partitioned with different block alignment? Otherwise performance, particularly on writes, suffers horrendously.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby glenn4uk » Wed Apr 17, 2013 11:27 pm

Semantics, I guess. SSD partitions do have to be properly aligned but that is not disk geometry since SSDs do not have Cylinders or Heads. And since Jonburton has a recent install of Linux (or even Win 7 or 8) on his spinning disk, his partitions are almost certainly aligned properly. So a dd will copy those aligned partitions exactly. I still think Clonezilla would be a better approach, however, since it will allow him to image to a flash drive and then restore to his new SSD.
glenn4uk
 
Posts: 5
Joined: Fri Nov 27, 2009 1:35 am
Location: Athens, Alabama, USA

Postby nelz » Wed Apr 17, 2013 11:44 pm

We don't know how old the laptop is or when the disk was partitioned, so that is not a safe assumption.

Even 4k block alignment is not sufficient for SSDs. Incidentally, hard drives don't use CHS geometry any more, it is all LBA now.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK


Return to Help!

Who is online

Users browsing this forum: Bing [Bot] and 1 guest