LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   moving to larger hard drive - having problems (https://www.linuxquestions.org/questions/linux-newbie-8/moving-to-larger-hard-drive-having-problems-615588/)

PAB 01-22-2008 05:36 PM

moving to larger hard drive - having problems
 
i'm using fedora 5. i've purchased a new hard drive (160GB) and want to move the contents of the old drive (40GB) to the new one. i've read a number of posts and information on this, but i'm still new to this and am having problems.

i did g4u first, and that worked excellent. however, as noted in a number of posts, the new hard drive partitions only used up 40GB of the 160GB. if i could understand how to resize the partitions afterwards, i would do that. however, i couldn't, so i started from scratch.

i used qtparted to make the new hard drive EXT3 for the boot section, followed by EXT3 for the majority of the size, followed by a swap of 1GB. the old drive had EXT3 for the boot section, followed by about 39 GB for the data, listed as LVM (or 8e in Fdisk).

i then mounted it as "new-disk" on the old drive, and used the following commands to move it over (in single user mode):

cp -a /boot /bin /etc /dev (all other folders) /new-disk

i created /new-disk/proc

i went into qtparted and set the first partition as active.

then, i shut down, unplugged the old hard drive, put the new on in its place, and then restarted.

i get a screen that says "GRUB" and that's it.

i can see the grub folder in the /boot section of the new hard drive.

am i missing something here? i'm assuming quite a bit, but maybe it is something small.

if someone could help me out a little, that would be great. i feel that it might be something to do with how i've partitioned everything. i realize that i have to get everything the same on both disks.

is the /boot partition the only partition that needs to be in the first section of the hard drive?

any suggestions are appreciated. Thanks!

PAB

Brian1 01-22-2008 06:09 PM

Ok with your setup I would do the following. Mirror the drive with Ghost 4 Linux as you did. Then you you need to boot with install cd and type ' linux rescue '. Let it mount the partition and type this command once system is mounted ' chroot /mnt/sysimage '. Now type the command ' grub-install /dev/hda ' for IDE since using fc5. Exit and reboot without the cd install.

Normally /boot is its own ext3 partition if you let the system do the partitioning for you. Then the rest is a LVM partition. Now the 40gig LVM cannot be change in size with any tools from gparted that I know of. But what you can do is create a new LVM with the remaining space and then merge the two into one. I have not mess with LVM much because of issue I see if certain things go wrong. I only use real partitions.

Brian

PAB 01-22-2008 07:56 PM

thanks brian for your response. when i used g4u, i didn't have a problem with grub or anything else, except that i didn't have access to about 120 gb of my drive. that's why i did what i did with the cp command, which then created the problem with grub.

just so i'm clear, are you suggesting
1. using G4U, then making the remaining 120GB of my drive as an LVM partition, and then merging? or;

2. using the HD that i have now (with the Grub error) and using the install CD to install Grub on it?

i can try either, but am just checking.

btw, i did try to make the 120GB into an LVM using Fdisk after using G4U (which is why i knew it is partition type 8e), but was getting an error message (i wished I wrote it down).

are there any tutorials on how to do this that anyone can suggest?

thanks!

pab

Brian1 01-23-2008 04:07 PM

I myself don't like LVM but you have to use the LVM tools to do the creation and Logical volumes. For the whole 120mb partition I guess fdisk can create and you assign it the type it is. Or you can use a gparted live cd to do the making of the partition. For the grub issue I would do the boot into rescue mode and do as I mention.

Brian

syg00 01-23-2008 07:25 PM

Go back and use g4u if it worked. Then either use the LVM tools to expand the pv, or create a new partition and add that as a new pv. Then grow the vg/lv, then resize the filesystem.
tldp.org has a good LVM guide, and redhat used to have some good articles as well (note I'm also not a LVM user).

PAB 01-24-2008 10:55 AM

thanks both of you for your replies. i tried using the LVM tools and got an error message with lvextend. upon searching, i found that there is a an old bug in lvm. so, i'm upgrading to fedora 8, which seems to have caused another problem, which i'm going to post in a new thread.

pab

PAB 01-24-2008 03:35 PM

well, i've gone back to the cloned system and have been able to work around the error to keep my system as is (as I was having problems with the upgrade/install of FC8). i've been able to get the system to recognize the added space.

here is what i've done (as best as i can remember).

-installed new disk as a slave
-used g4u. used command "copydisk wd0 wd1" after using command "disks" to verify that wd0 is old and wd1 is the new one. waited for the transfer to finish (about 30 minutes for 40GB)
-installed the new disk as the master and removed the old disk.
-went into terminal as root. "fdisk /dev/hda"
-created a new partition for the free space that wasn't recognized (used the commmand "n"). primary partition, with the next highest number (used fdisk -l to figure that out). rest of the values were the default values.
-next command was "t". then entered the partition number that i just created. then used hex code of "8e" which is LVM.
-then "w". i did get an error message (error 16 - system busy) but it still worked out.
-then used the gui to alter the LVM. you get there by typing, in terminal, "system-config-lvm".
-in the gui, you see on the left hand side a section that i believe said "uninitiated". click on that and then click on the partition just created. then click on the button on the bottom that states "initialize" or something like that.
-then that partition is moved up to a section that i believe is "unallocated". click on that, and then the partition again. then click on the button to add it to the volume group.
-close out of the gui.
-back in the terminal, i did "vgdisplay". looked at the "VGsize" part and noted that it was 140.91gb.
-typed "lvextend -L140.91G /dev/VolGroup00/LogVol00". this is where i got the error messages that kept me from continuing. it stated that there was insufficient space. so, i just decreased the size from 140.91 to 140, and it worked.
-typed "ext2online /dev/VolGroup00/LogVol00". waited for a bit. then it completed. i was able to see that i had access to the full drive now.

hope this helps. as i'm new to this, i don't understand it well myself but thought that, since i see a lot of LVM posts ending without help or beginning with "i don't use LVM myself but...", i thought that this might help someone else who's having a problem.

pab

syg00 01-24-2008 05:16 PM

Nice - now everyone can stop asking ...:p
Easy ....

Brian1 01-26-2008 10:28 AM

Very nice to post a fix for others to use if they have the same issues.

Brian


All times are GMT -5. The time now is 12:25 PM.