LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 10-12-2005, 10:09 PM   #1
seriesx4
Member
 
Registered: Mar 2005
Location: Sweden
Posts: 64

Rep: Reputation: 15
Copy an entire install to second harddisk


I have two harddisks, one big and one small. Linux is installed on the small one. Windows is on the big one.

I want to move Linux to the big HD, and I wonder if there is a way to move my current installation from the small disk to the big disk ( just copy the entire filesystem ) and be able to boot from it ( maybe by changing grub.conf and fstab ). That way I don't have to reinstall och configure everything again.

Would it work to just copy the entire filesystem to the big disk, install grub, change some config files which deals with HD numbers, and boot from the big one?
 
Old 10-12-2005, 10:14 PM   #2
narmida
Member
 
Registered: Mar 2005
Location: Alphen aan den Rijn , netherlands
Distribution: core
Posts: 57

Rep: Reputation: 15
command "dd" is what u want but it takes some configuring and planning if you not familiar with linux as i gues.
DONT you just erease your windows partition or something.
if it fails you must know how to recover with a rescue cd etc.

just reinstall on the other part is then the best option.
"Just copying never works with all OS"
Linux is good but no wizard
 
Old 10-12-2005, 10:16 PM   #3
Gort32
Member
 
Registered: Sep 2004
Distribution: Slack!
Posts: 150

Rep: Reputation: 15
Actually, just a straight copy should work just fine if you perform the copy running under a resuce disk. Copying a currently-running system will leave you with stale lock files and other garbage, but booting into a rescue disk and dd'ing one drive to another should work well enough, especially if the drives are the same size.
 
Old 10-12-2005, 10:28 PM   #4
seriesx4
Member
 
Registered: Mar 2005
Location: Sweden
Posts: 64

Original Poster
Rep: Reputation: 15
Quote:
DONT you just erease your windows partition or something.
Actually, I want to erase it and put Linux there.

The partitioning on the Linux drive is simple BTW - everything is on one primary partition.

I'll probably try 'dd' from a rescue disk. If anyone has any additional advice, pointers, info, etc, don't hesitate to share.
 
Old 10-12-2005, 10:37 PM   #5
seriesx4
Member
 
Registered: Mar 2005
Location: Sweden
Posts: 64

Original Poster
Rep: Reputation: 15
BTW:

Quote:
command "dd" is what u want but it takes some configuring and planning if you not familiar with linux as i gues.
Quote:
just reinstall on the other part is then the best option.
The problems I'm facing are the problems I want to overcome, not let them rule my decisions... I have everything of value backed up anyway so it doesn't matter if I screw up.
 
Old 10-13-2005, 10:58 AM   #6
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
Hmm, dd will, by definition, replicate the entire partition. Since the target drive is bigger than the old drive, dd is of no use here.

Mount your new partition on /mnt, create a file (say, /tmp/exclude-list) with all the directories you want to exclude from the copy (i.e. /mnt, /proc, /tmp, /var/tmp, /sys and so on). Then a,

tar cf - / -X /tmp/exclude-list | tar xf - -C /mnt

Or if you use zsh, you can do it from the command line,

tar cf - /*~/proc~/mnt~/sys~/tmp~/whatever | tar xf - -C /mnt

Of course, you'll need to install grub/lilo on the new disk.

As for stale lock files, well, there's this handy command called 'rm', maybe you've heard of it?
 
Old 10-13-2005, 11:17 AM   #7
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: West Sussex, England
Distribution: Gentoo
Posts: 1,457

Rep: Reputation: 45
I put a step-by-step guide to exactly this process at the bottom of the "Getting started with Linux" link in my sig - take a look!
 
Old 10-13-2005, 11:44 AM   #8
seriesx4
Member
 
Registered: Mar 2005
Location: Sweden
Posts: 64

Original Poster
Rep: Reputation: 15
Actually, everything went just fine. I used nothing else but cp, and then reinstalled grub.

I had to fiddle a little after removing hdd, but it wasn't so bad.

I did the stupidest thing however: I forgot to make a swap partition. I'll have to try to resize my current partition with parted and make room for a new swap... parted however, says something like: "The filesystem contains a feature not supported" or something similar...
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy an entire directory structure except certain files? thanhvn Programming 9 01-27-2012 11:41 AM
Using wget to copy entire ftp directory stuartmunro Linux - Newbie 7 06-17-2005 07:06 PM
how to copy entire website using linux ngan_yine Linux - Newbie 3 03-09-2005 04:04 PM
is it possible to copy an entire fc2 system to another disk? parv Fedora 8 09-20-2004 06:04 PM
Low Harddisk space. Can I just transfer the entire Linux to a bigger harddisk? davidas Linux - Newbie 12 04-13-2004 02:03 AM


All times are GMT -5. The time now is 06:42 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration