My problem is simple. I never though my little sever could become that popular in my home. So i need a bigger hard drive. But what is the fastest way to change the primary hard drive ?
1- Can I just copy the entire disk on the new hard drive ? (after making the good partitions)
2- Do I have to reinstall everything, but copy etc folder in the new installed HD :? ?
3- Do I have to reinstall it from scratch ?
4- Do you have any idea ?
P.S. : the actual HD is old... only mounting home on the new hd would have been good option but I want this to be permanent.
1: Yes you can. Mount both discs under a live cd, copy -a /mnt/src /mnt/dest, edit your boot loader and fstab. Make sure you put that little -a in the copy command.
4: yes, see 1.
I'm sure someone else would catch this, but copy likely won't get you too far. Use cp.
I've been working with DOS at work. Sorry about that. I've typed 'dir' five times since I got home. It still works, but without proper colouring.
Will a cp command change ownership or permissions ? Like, evything is going to be owned by root...
if you use 'cp -a', it will preserve ownership, permissions, symlinks, etc.
To be sure, you could also tar up the entire drive and untar it to the destination drive.
I've done it both ways. As long as you get lilo and fstab set up properly it works.
If you use cp without the -a, it is messy as far as permissions go. I did that once too. :-D
Thanks a lot Dusty. Linux is great, but when you have to reinstall and you have a lot of stuff already configured, it is a pain in the *** to reconfigure every deamon, desktop, user, permissions... Especially when iis working so great for once !!! (since I installed Arch in fact)
I guess you know how much time and sweat you save me from
yeah, configuring linux can be tough. On the other hand, trying to copy Windows from one partition to another would be a much huger headache than doing this with Linux. :-)
Yep, there's numerous ways to accomplish it with *nix. :-)
You can use a number of tools: tar, cpio, dump, etc..
You could also use any of a number of partition image tools.
Just as a quick example of cpio:
1) once you're booted with the live-cd, mount the old disk as something like /mnt/src and the new disk as /mnt/dest (like Dusty mentioned above).
2) cd /mnt/src
3) find . –depth –print | cpio –pdmv /mnt/dest
That would pipe the output from the find command into cpio and save the ownerships/permissions, etc..
Some of the world's greatest feats were
accomplished by people not smart enough
to know they were impossible.
-- Doug Larson
I did wath Dusty said : cp -a mnt/src mnt/dest ... everything have copy well, one problem. It don't boot. The computer says : no operating system. I know aproximately why, I only copy the files and grub was not installed properly so nothing was written on the part where the bios look. In windows, I think it was possible to solve this with
but in linux, any fast and easy way to do this ? A boot disk would be good since this computer have no cd drive. Oh, and if the fdisk from windows 98 is suppose to work, tell me because I have a win98 boot disk an it can be the fastest solution.
P.S. I'm sure cpio or anything else would have done the job but the process is long and I have a lot of hardware manipulations to do. Redoing the copy again is my last option.
You shouldn't have to copy again. It sounds like you forgot to run the boot loader after loading. I did say "make sure you edit your boot loader and fstab". ;-)
Download toms root boot:
install it to a floppy
boot from the floppy
mount the drive
edit /mnt/mydisk/etc/fstab to ensure the devices point to the new drive. If the old drive was hda, and the new one was hdb2 change the as to bs, etc.
edit /mnt/mydisk/boot/menu.1st (that's what grub is, right? :-S) to ensure that it will boot the new drive (change hdas no hdbs again).
run grub-install or whatever it is.
(INstructions may need tweaking. I wrote them from memory, and I don't need grub)
Problem: no devices inside chroot...
solution: maybe... before you chroot
cp -a /dev/hda /dev/hdb /dev/hda1 /mnt/disk/dev
That will create static nodes for those particular devices. I find its useful to have these when rescuing because udev/devfs aren't started inside. Maybe somebody else knows how to start it.
I finally get it to work ! The boot disk from http://www.toms.net/rb/ was great but too old to work. So I took a well know road... recopy everything again. This time, I did an Arch installation (automated partitionning) from the CD as simple as I could, I did not even take a look at the config files since only the "installing bootloader" part was interesting... After that, I simply overwrite everything one the new HD with stuff from the old HD and it worked! I had to do a lot of hardware manipulation because my server is a really compact Compaq, not even enought plug on the power supply to supply more than two devices plus the floppy drive. So I did the transfer on my desktop computer with a little help from Archie. Great tool by the way ! So thanks for the help, I learned a lot in the process