LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Copy an entire install to second harddisk (https://www.linuxquestions.org/questions/linux-general-1/copy-an-entire-install-to-second-harddisk-372482/)

seriesx4 10-12-2005 10:09 PM

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?

narmida 10-12-2005 10:14 PM

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

Gort32 10-12-2005 10:16 PM

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.

seriesx4 10-12-2005 10:28 PM

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.

seriesx4 10-12-2005 10:37 PM

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.

ioerror 10-13-2005 10:58 AM

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?

oneandoneis2 10-13-2005 11:17 AM

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!

seriesx4 10-13-2005 11:44 AM

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...


All times are GMT -5. The time now is 10:57 AM.