LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Going to replace hard drive - should I switch distro too? (https://www.linuxquestions.org/questions/linux-general-1/going-to-replace-hard-drive-should-i-switch-distro-too-319713/)

FiveFlat 05-03-2005 09:55 AM

Going to replace hard drive - should I switch distro too?
 
My home server (which I finally have setup the way I like it after about 2 years) has a 20GB hda, running FC3. It is now about 70%full and I want to replace it (maybe?) with another 80GB I have. I have a few options (I think) and I wanted some of you all to assist me with picking one of them. Here they are:

1. Replace my 20GB drive with the 80GB drive and simply(?) copy all data over.

2. Replace my 20GB drive with the 80GB and start fresh with new distro

3. Leave my 20GB drive inplace and add the 80GB drive and move /home


I have many different opinions myself:
Option 1 is good except it seems a little difficult.

Option 2, I'm a little scared to do because I'm afraid it'll take me another 2 years to get the new one the way I like it. But it's an opportunity to upgrade to a better distro (oops - not trying to make a "whats the best distro" thread out of this)

Option 3 seems the easiest, but it involves buying a new hard drive and I really feel like I *need* to put the 80GB drive in my server instead of my son's PC :)

I appreciate all your opinions!

oneandoneis2 05-03-2005 10:05 AM

#1 is easy, so long as you have a Knoppix CD or similar - it's best to copy files from an inactive drive.

#2 could potentially be a lot of work. On the other hand, I know MY /home dir is full of clutter after moving it around 3 distros, so it could be a good chance to clear out some of the crud.

#3 I must have misunderstood. If you have an 80GB drive, why would you need to buy a new one? Or do you mean you're going to swap the 20 and 80 drives between two machines?

I'd probably go with #1 unless I really wanted a new distro. Apart from anything else, with that much extra space, you can add a partition later and install another distro to play around with first

FiveFlat 05-03-2005 10:11 AM

Ah yes, the 80GB drive is coming out of my son's PC (which I haven't setup yet) I would need to get him a new drive for option #3. So it sounds like you perfer option #1 - You don't see any problems with FC3 as a distro for home server. It's currently IP masq. a dialup. But by this weekend I will have broadband and I plan on doing more with it (like redirecting subdomains from my webhost to it, etc.)

oneandoneis2 05-03-2005 10:49 AM

I'd be a bit paranoid about using my home PC as a webhost as well. But that's a personal thing - means I can have a firewall that just says "No" to everything incoming, rather than letting traffic in.

#1 is dead easy, so long as you have a distro independant of hard-drive, and you remember to use the switch to tell "cp" to preserve file permissions etc. I forget what it is

FiveFlat 05-03-2005 11:09 AM

true, webhost might be the wrong thing. I basically need to be able to access it from work though and get files if I need them.

I think you've convinced me that #1 is the right thing to do. And like you said - I can leave a partition for another distro. Is parted very reliable when it comes time to resize partitions later on down the road?

oneandoneis2 05-03-2005 11:26 AM

No idea, I just leave excess space unformatted so I can add a partition later. I've still got 20GB or so untouched on my HD. . .

harken 05-03-2005 12:27 PM

I'd say there's something more to add to #1: if you copy the files with something like 'cp', you also need to write the MBR in order for the new HD to boot. You can do this by running something like 'grub-install' or the equivalent for LILO.
If, instead, you use 'dd', you must then adjust the HD size with something like tune2fs if I'm right.

oneandoneis2 05-03-2005 01:19 PM

You can always install grub to the new MBR. . . but yes, it is something that needs to be taken into account

FiveFlat 05-03-2005 01:32 PM

Quote:

Originally posted by harken
I'd say there's something more to add to #1: if you copy the files with something like 'cp', you also need to write the MBR in order for the new HD to boot. You can do this by running something like 'grub-install' or the equivalent for LILO.
If, instead, you use 'dd', you must then adjust the HD size with something like tune2fs if I'm right.

So, after I copy all files (I believe the correct tags would be -aix ?) Would I then remove the first drive, change the 80GB drive to master and then boot (from knoppix?) to grub-install?

harken 05-03-2005 01:37 PM

Something like that. You boot with Knoppix, open up a console and run
Code:

mkdir /mnt/newdrive
mount /dev/hda1 /mnt/newdrive
chroot /mnt/newdrive /bin/bash
grub-install /dev/hda1
exit
umount /dev/hda1

if the new HD will be the only one present and the Linux kernel is on the first partition. Otherwise, change hda1 to whatever appropriate.

FiveFlat 05-04-2005 09:42 AM

I need a little clarification on something. I partitioned my hard drive like this:

/dev/hda1 /boot
dev/hda2 /
/dev/hda3 /home
/dev/hda4 swap

(the only difference is that I created a different partition for /home - it was originally in /dev/hda2 / )

so should I type:
Code:

grub-install --root-directory=/dev/hda1
or
Code:

grub-install --root-directory=/dev/hda2
I tried the former and when I boot - it comes up with:

Grub error 15
press any key to continue

if I press any key I get the splash screen - but it is all black and white and VERY garbly. If I select my kernel and hit enter it comes back with :

file not found

harken 05-04-2005 09:46 AM

It should be
Code:

grub-install /dev/hda1
. The --root-directory has a somewhat other purpose: http://www.gnu.org/software/grub/man...20grub-install

FiveFlat 05-04-2005 09:54 AM

Ah - I should have simply done what you said to begin with, instead of thinking I knew what I was doing. ;)
I'll have to wait to get home tonight to try it.
Thanks

FiveFlat 05-05-2005 09:18 AM

okay - I boot to knoppix and mounted hda1 to /mnt/hda1
if I try to:
chroot /mnt/hda1 /bin/bash
I get:
'no such file" bash . If I whereis bash, it's in /bin/bash

If I try to:
grub-install /dev/hda1
I get:
cannot write, read-only filesystem (yes I am root) I can however run:
grub-install --root-directory=/mnt/hda1 /dev/hda1


After many hours messing around with grub.conf I finally got somewhere though. At this point, after the latter 'grub-install' command, my /dev/hda1 structure looks like this:
/boot
kernel and initrd files
/boot/grub
grub.conf and other related grub files

It still does NOT boot up without the nice blue splashscreen and is very garbly and comes up with "FILE NOT FOUND" when it looks for the kernel. So I have to manually type the exact same lines that are in my conf file below (from the root (hd0,0) line down of course)
I manually had to edit grub.conf and add "/boot" before the kernel and initrd lines to get it to boot.
my grub.conf:
Code:

#grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda2
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Fedora Core (2.6.9-1.667)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.9-1.667 ro root=/dev/hda2
        initrd /boot/initrd-2.6.9-1.667.img

Now, with it booted up and running everything runs like a champ. Although, from a terminal if I "cd /" there is not a /boot directory. I had to manually create /boot and then mount /dev/hda1. Now I have /boot/boot/grub/ etc.

:confused:

oneandoneis2 05-05-2005 09:25 AM

Quote:

chroot /mnt/hda1 /bin/bash
I thought hda1 was your /boot partition? Shouldn't you try to chroot to hda2?

Quote:

my /dev/hda1 structure looks like this:
/boot
Eh? If hda1 is /boot, you don't want a /boot in it! That'll create /boot/boot!

Have you changed your partitioning scheme since the one you listed above? If not, then your problem is that you seem to be treating the /boot device as the / device. . .


All times are GMT -5. The time now is 01:19 PM.