Linux - GeneralThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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).
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.
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.
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!