OK, I have a new 60GB drive to place on my 20GB Linux box. Don't get excited - its only IDE. I thought I would reclaim the 20GB for some lesser role in life. Is is best to do a re-install and then somehow (how?) move the settings from the old drive to the new. -Or- should I format the paritions (how exactly) and then copy (how? if I want to keep acls etc) data from old to new drive. And do I then need to make it bootable? (As usual, you will gather from this that my ignorance knows no bounds) - and BTW - are we going to get a special offer price on SUSE 8.0?
On Mon, 2002-04-08 at 20:08, Alan Davies wrote:
OK, I have a new 60GB drive to place on my 20GB Linux box. ... Is is best to do a re-install and then somehow (how?) move the settings from the old drive to the new.
What I normally do (on Debian, but should work on any GNU/Linux) Plug the new disk in as master on the second cable (/dev/hdc) boot the machine into single user ("Linux single" at the LILO prompt) partition the new disk: cfdisk /dev/hdc using the same layout might make life easy, but is not essential. Let's assume you have: /dev/hda1 /boot /dev/hda2 / /dev/hda5 [swap] /dev/hda6 /home partition the drive to match, making the partions bigger if space was getting tight before. The do: mke2fs /dev/hda1 mke2fs /dev/hda2 mkswap /dev/hda5 mke2fs /dev/hda6 mount /dev/hda2 /mnt cd / cp -avx . /mnt mount /dev/hda1 /mnt/boot cd /boot cp -avx . /mnt/boot mount /dev/hda6 /mnt/home cd /home cp -avx . /mnt/home so now you've coppied everything, but it's not bootable. The easy option is to make yourself a boot floppy (with mkboot on Debian, not sure if SuSe has that), shut down, pull the old drive out, and plug the new on in it's place, boot off the floppy, log in and run LILO (or GRUB, or whatever) to reinstall the boot block. You may need to install the MBR onto the start of the disk, if you've got LILO on /dev/hda1, say (on Debian, you do that with install-mbr, otherwise you need to get the MBR package, and dd it onto you hard disk --- probably easier to simply put LILO on /dev/hda) Reboot and your done. Of course, I always forget the boot disk, and have to do the: rescue root=/dev/hda2 thing off an install disk, and hope the file systems are supported on that kernel. If you hate floppies with a vengence, you need to put: disk=/dev/hdc bios=0x80 in /mnt/etc/lilo.conf when you've just done the disk copy, before rebooting, and then run: lilo -r /mnt and if you get no complaints, you've got a good chance of a clean reboot (but I'd still make a floppy ;-) Have fun. Cheers, Phil. -- Say no to software patents! http://petition.eurolinux.org/ |)| Philip Hands [+44 (0)20 8530 9560] http://www.hands.com/ |-| HANDS.COM Ltd. http://www.uk.debian.org/ |(| 10 Onslow Gardens, South Woodford, London E18 1NE ENGLAND
In article
OK, I have a new 60GB drive to place on my 20GB Linux box.
As philhands outlines ... there is also a mini hard disk upgrade howto. My addition is to say remember with suse that one needs to create the /proc directory on what will be the new / partition (or at least I did, perhaps its changed with more recent distributions, anyway when I failed to do this the attempt to reboot with the new disk failed with all sorts of errors, but that was a while back, v 6.summat). The mini howto is worth a read, anyroad. Another problem that cropped up - unless it was just my config and distributions (now upgraded to 7.2) - if you are trying to get lilo to work on an addin diskcontroller card (like a Promise ata/100) this will put the disks in as hde and hdg. Getting lilo under yast or suse to recognise this is a problem, as for some reason yast and lilo always removed the spaces in the lilo.conf line hde = bios 0x80 or something like that (can't quite remember the syntax now), so it would always tell me that couldn't install on mbr on anything except hdc, and it wouldn't write any sort of boot sector. No idea why... had to lug the disk out and install boot on another distribution (mandrake 7.0) and everything worked OK. I now use removeable disk caddies :-) which have the advantage of a small cooling fan in the front (these ata 100 disks run HOT HOT HOT). Malcolm in Oxford
On Mon 08 Apr, Philip Hands wrote:
On Mon, 2002-04-08 at 20:08, Alan Davies wrote:
OK, I have a new 60GB drive to place on my 20GB Linux box. ... Is is best to do a re-install and then somehow (how?) move the settings from the old drive to the new.
What I normally do (on Debian, but should work on any GNU/Linux)
Plug the new disk in as master on the second cable (/dev/hdc)
boot the machine into single user ("Linux single" at the LILO prompt)
partition the new disk:
cfdisk /dev/hdc
using the same layout might make life easy, but is not essential. Let's assume you have:
/dev/hda1 /boot /dev/hda2 / /dev/hda5 [swap] /dev/hda6 /home
partition the drive to match, making the partions bigger if space was getting tight before.
The do:
*********Should the following lines be ....hdcX - ? rathern than hda?
mke2fs /dev/hda1 mke2fs /dev/hda2 mkswap /dev/hda5 mke2fs /dev/hda6 mount /dev/hda2 /mnt cd / cp -avx . /mnt mount /dev/hda1 /mnt/boot cd /boot cp -avx . /mnt/boot mount /dev/hda6 /mnt/home cd /home cp -avx . /mnt/home
so now you've coppied everything, but it's not bootable.
The easy option is to make yourself a boot floppy (with mkboot on Debian, not sure if SuSe has that), shut down, pull the old drive out, and plug the new on in it's place, boot off the floppy, log in and run LILO (or GRUB, or whatever) to reinstall the boot block. You may need to install the MBR onto the start of the disk, if you've got LILO on /dev/hda1, say (on Debian, you do that with install-mbr, otherwise you need to get the MBR package, and dd it onto you hard disk --- probably easier to simply put LILO on /dev/hda)
Reboot and your done.
Of course, I always forget the boot disk, and have to do the:
rescue root=/dev/hda2
thing off an install disk, and hope the file systems are supported on that kernel.
If you hate floppies with a vengence, you need to put:
disk=/dev/hdc bios=0x80
in /mnt/etc/lilo.conf when you've just done the disk copy, before rebooting, and then run:
lilo -r /mnt
and if you get no complaints, you've got a good chance of a clean reboot (but I'd still make a floppy ;-)
Have fun.
Cheers, Phil.
At what stage can you remove old drive and move new drive to the other IDE channel? Will it boot after moving - or does it 'know' that it was hdc? -- Alan Davies Head of Computing Birkenhead School
On Fri, 2002-04-12 at 16:08, Alan Davies wrote:
*********Should the following lines be ....hdcX - ? rathern than hda?
Yes, they certainly should be hdc -- oops. Good job mke2fs would complain about the hda ones being mounted, eh?
mke2fs /dev/hda1 mke2fs /dev/hda2 mkswap /dev/hda5 mke2fs /dev/hda6 mount /dev/hda2 /mnt cd / cp -avx . /mnt mount /dev/hda1 /mnt/boot cd /boot cp -avx . /mnt/boot mount /dev/hda6 /mnt/home cd /home cp -avx . /mnt/home
so now you've coppied everything, but it's not bootable.
The easy option is to make yourself a boot floppy (with mkboot on Debian, not sure if SuSe has that), shut down, pull the old drive out, and plug the new on in it's place, boot off the floppy, log in and run LILO (or GRUB, or whatever) to reinstall the boot block. You may need to install the MBR onto the start of the disk, if you've got LILO on /dev/hda1, say (on Debian, you do that with install-mbr, otherwise you need to get the MBR package, and dd it onto you hard disk --- probably easier to simply put LILO on /dev/hda)
Reboot and your done.
Of course, I always forget the boot disk, and have to do the:
rescue root=/dev/hda2
thing off an install disk, and hope the file systems are supported on that kernel.
If you hate floppies with a vengence, you need to put:
disk=/dev/hdc bios=0x80
in /mnt/etc/lilo.conf when you've just done the disk copy, before rebooting, and then run:
lilo -r /mnt
and if you get no complaints, you've got a good chance of a clean reboot (but I'd still make a floppy ;-)
Have fun.
Cheers, Phil.
At what stage can you remove old drive and move new drive to the other IDE channel?
Any time after you've copied all the partitions. Probably after you've created a boot floppy, or after you've managed to get the lilo -r /mnt to make encouraging noises, depending on your chosen route. Even if you cock up both the lilo and the boot floppy, a rescue disk, and speifying "Linux root=/dev/hda" at the boot prompt will probably sort you out, and if not you can always start from scratch with te old disk, so it's not something to get too stressed about (as long as you can avoid dropping the old disk while doing all this ;-)
Will it boot after moving - or does it 'know' that it was hdc?
If you do the "disk=/dev/hdc bios=0x80" thing, it tells lilo to use the first disk's bios number (0x80) on the disk regardless of it being currently located at hdc, so once it's moved it will try to boot off of itself (now hda, aka 0x80), rather than /dev/hdc (aka 0x82). Hm, that's a clear as mud, is it not? Oh well, try reading it again a few times ;-) Cheers, Phil. -- Say no to software patents! http://petition.eurolinux.org/ |)| Philip Hands [+44 (0)20 8530 9560] http://www.hands.com/ |-| HANDS.COM Ltd. http://www.uk.debian.org/ |(| 10 Onslow Gardens, South Woodford, London E18 1NE ENGLAND
On Fri 12 Apr, Philip Hands wrote:
On Fri, 2002-04-12 at 16:08, Alan Davies wrote:
*********Should the following lines be ....hdcX - ? rathern than hda?
Yes, they certainly should be hdc -- oops. Good job mke2fs would complain about the hda ones being mounted, eh?
mke2fs /dev/hda1 mke2fs /dev/hda2 mkswap /dev/hda5 mke2fs /dev/hda6 mount /dev/hda2 /mnt cd / cp -avx . /mnt mount /dev/hda1 /mnt/boot cd /boot cp -avx . /mnt/boot mount /dev/hda6 /mnt/home cd /home cp -avx . /mnt/home
so now you've coppied everything, but it's not bootable.
The easy option is to make yourself a boot floppy (with mkboot on Debian, not sure if SuSe has that), shut down, pull the old drive out, and plug the new on in it's place, boot off the floppy, log in and run LILO (or GRUB, or whatever) to reinstall the boot block. You may need to install the MBR onto the start of the disk, if you've got LILO on /dev/hda1, say (on Debian, you do that with install-mbr, otherwise you need to get the MBR package, and dd it onto you hard disk --- probably easier to simply put LILO on /dev/hda)
Reboot and your done.
and if you get no complaints, you've got a good chance of a clean reboot (but I'd still make a floppy ;-)
Have fun.
Cheers, Phil.
OK copied all. Lilo gives error message when trying to write to boot Fatal open /boot/boot.b no such file/directory I suspect that I copied the /boot entry to the root (or at least thats where the kernel files appeared on the new disk - I'm not sure that I made a mistake typing your commands though. So I copied files from root into the boot partition - ran lilo (now successful) and it now boots BUT Re-booting gives an error that it failed to find a swapfile signature. So how do I restore a signature? -- Alan Davies Head of Computing Birkenhead School
participants (3)
-
Alan Davies
-
mblackmore@oxlug.org
-
Philip Hands