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 01-06-2009, 04:09 PM   #1
digity
Member
 
Registered: Apr 2005
Posts: 105

Rep: Reputation: 15
clone hard drive to smaller hard drive


how do I clone my 80 GB drive with Ubuntu 8.10 (70 GB free) to a smaller 40 GB hard drive?
 
Old 01-06-2009, 04:13 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
If you mean raw, brute-force cloning, you don't. The two options I would consider:

1. Resize the Ubuntu partition(s) so it(they) will fit on the smaller drive, then clone.

2. Install Ubuntu on the smaller drive and copy your data. This is the safest way to go.

I think there are cloning utilities that will also do re-sizing, but I have no personal experience.
 
Old 01-10-2009, 07:33 PM   #3
digity
Member
 
Registered: Apr 2005
Posts: 105

Original Poster
Rep: Reputation: 15
So I went with the first option and resized the ext3fs partition (sdb1) of which Ubuntu is installed and successfully cloned it to the smaller hard drive using partimage (though I haven't tried to boot from the new smaller drive yet; I've done everything remotely so far, so I'm not in front of the actual computer). Do I have to worry about the Extended (sdb2) and linux-swap partitions (sdb3) in terms of cloning or was creating those partitions with gparted enough?
 
Old 01-10-2009, 07:42 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,533

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
I really (I mean *really*) don't like imaging like that - better to set up target partitions and use a filesystem copy (cp, rsync, ...).
You should be fine with the swap - although with Ubuntu (using UUID) you'll probably need to fix the fstab entry.
 
Old 01-11-2009, 02:40 AM   #5
digity
Member
 
Registered: Apr 2005
Posts: 105

Original Poster
Rep: Reputation: 15
booya! worked sorta like magic. had to re-install grub using Live disc (I got a grub error 2), but after I rebooted everything came up and I'm back to normal with a new drive. got my first Linux cloning experience under my belt, feels good. partimage is a gawd send

how do I know for sure I *need* to fix the fstab entry for swap?
 
Old 01-11-2009, 02:54 AM   #6
digity
Member
 
Registered: Apr 2005
Posts: 105

Original Poster
Rep: Reputation: 15
got swap's UUID by running <blkid> at the command line and updated the fstab.

so far, so good. am I missing anything else?
 
Old 01-11-2009, 03:10 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,533

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Nah, you should be o.k.
But if not, you'll find out ...

Well done.
 
Old 01-11-2009, 03:42 PM   #8
digity
Member
 
Registered: Apr 2005
Posts: 105

Original Poster
Rep: Reputation: 15
Thanks, everyone!
 
Old 01-11-2009, 06:29 PM   #9
bapigoo9
Member
 
Registered: Aug 2008
Posts: 107

Rep: Reputation: 16
Quote:
Originally Posted by digity View Post
how do I know for sure I *need* to fix the fstab entry for swap?
Post your /etc/fstab
 
  


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
Clone a dual booting IDE hard drive to a SATA hard drive namida12 Linux - Distributions 1 07-14-2008 10:01 AM
Using dd to clone my hard drive Tommo Linux - Hardware 15 05-20-2007 03:49 PM
Bigger Hard Drive - Clone? Snump Mandriva 14 11-21-2006 08:37 AM
Needing help copying large hard drive to smaller drive sdubble Linux - Software 1 02-21-2006 12:06 PM
Clone a hard drive twantrd Solaris / OpenSolaris 10 02-05-2005 02:15 AM


All times are GMT -5. The time now is 02:40 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