LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Moving an entire Linux installation ... (https://www.linuxquestions.org/questions/linux-general-1/moving-an-entire-linux-installation-241749/)

dhave 10-12-2004 11:04 AM

Moving an entire Linux installation ...
 
I'd like to move my entire Linux installation to another hard drive. On my current drive, I have Linux (Slackware) on hda3 and the swap partition on hda2. Hda1 is a Windows installation.

The structure of the existing drive and the new drive is not the same. On the new hard drive, this Linux installation will need to reside in hda4, with the swap partition at hda3 (hda2 is occupied by a Fedora installation that I need to leave alone; hda1 is a current WinXP installation).

Also, the size of the new partition will be larger than the partition where it is now.

Can I just copy over everything on existing drive's hda3 partition to new drive's hda4? Are there system files that might not copy without special attention (you can tell I'm coming from a Windows background). Then just edit the bootloader, (I think it's grub) that's already installed on the new hard drive, so that the kernel on hda4 will boot?

Is there anything else I'm overlooking? Or is there a better way? If any of you systematic types could jot down the steps, that would probably help. I have a lot of PC experience, but I find that, with things like this that I do only occasionally, it's easy to overlook a critical step.

I had been planning to simply reinstall Slackware on the new drive, but I spent so much time getting it just right that I hate to do that (kernel upgrade and recompile, lots of tweaking elsewhere).

Thanks!

dhave 10-14-2004 12:12 AM

[bump]

acid_kewpie 10-14-2004 03:01 AM

it's not fun, but certainly possible. there are a fair few approaches, but this is what i do:

http://www.linuxquestions.org/questi...threadid=88106

doing straight copies is never fun. you have symbolic links and things that are more than likely to come a cropper somewhere. you're confusing the hell outta me my calling both hard drives hdaX, the second hard drive will be hdb, not hda.

but as everything is within one partition (not desirable in the grand scheme but...) it should be a lot easier to spread things into a partition mounted in /mnt or such like. you could also add a home partition on the new drive, mount that as /mnt/home (i.e. within the new root dir) and during the single copy command you need your home will magically end up with it's own partition.

tredegar 10-14-2004 06:43 AM

try this link, it covers just about everything, and zaipher is also running slack.

Link: http://www.linuxquestions.org/questi...hreadid=224324

dhave 10-15-2004 12:42 PM

Thank you both for your help. It was an education just reading your instructions.

I tried some basic copying from partition to partition and found that the permissions were going goofy, so I finally decided to just reinstall Slack on the new drive. I had spent hours getting everything ticking on my previous installation, which is why I wanted to just move it in one go. But the second installation went well, and I remembered all the tweaks and adjustments to get Slack humming along. I went ahead and upgraded the kernel and adding better USB support in the process.

All in all, it was fun to reinstall, so I'm glad I got scared off of the copying deal. Some other time I might try it.

I was calling both drives "hda" because I was thinking of them from the perspective of the installation. I'm working in a single-hd laptop, using an external hard drive to copy off my stuff to be restored. Since only one internal drive is installed at a time, it's always "hda" -- on my setup, anyway. But thanks for pointing out the confusion.

tredegar 10-15-2004 04:33 PM

clawhead,

As you have discovered, just copying will not work as it will not handle the file permissions in the way that you want: that is why you need to move the files using tar (while running as root). This method preserves the file ownerships, permissions and whatnot.

Anyway, you have got to be where you wanted to be, and this is perhaps one of the beauties of linux - there are lots of different ways to achieve what you need. Some methods more 'elegant' than others, but all most of us care about is the end result!

Well done.

drirr 10-19-2004 02:40 PM

Here's a guide I found: http://p-two.net/hard-drive/hard-drive.html, it might help you.

dhave 10-19-2004 02:52 PM

Quote:

Originally posted by drirr
Here's a guide I found: http://p-two.net/hard-drive/hard-drive.html, it might help you.
Very good resource that I've bookmarked for the next time I try this (November, at this rate ...). Thanks.


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