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.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My main root parition was only made with about 5 gigs, and it is filled up :O
Today, i deleted my old RH install off my second hard drive, SO i have a whole bunch of unpartitioned space.
Is there a way for me to move my / parition to my second drive, and thereby letting it grow in size?
I mean, Say i create a 10 gig ext3 partition on my second drive:
I need to
a) Copy all the data exactly from my 5 gig partition to the new 10 gig one
the
b) Set it up so the new parition is viewed as the / partition
I don't see any problem, simply mount the new partition on, e.g., new, and launch as root a
Code:
cp -a /* /new
You'll get an error message at the end, but that's no problem.
Then you'll have to update 2 things BEFORE rebooting:
1. your lilo or grub conf file. In the first case,, remember to re-run lilo. In the latter, be sure to remove the old grub.conf or menu.lst on hda, or that will be used instead
2. your /etc/fstab of course
After rebooting you can get rid of old partition
Note that you can even safely move some branches, too. Say you want to move only /usr:
Code:
cp -a /usr /new/
rm -r /usr (this may cause problems if other tasks/users are running)
ln -s /new/usr /usr
or you can instruct /etc/fstab to mount hdb1 as /usr
Hm....i made a /new partition...a couple questions thought
Im looking at man cp
-a, --archive
Preserve as much as possible of the structure and
attributes of the original files in the copy (but
do not preserve directory structure). Equivalent
to -dpR.
WHat does that mean, does not preverse direcotry structure? Dont i need that?
Also,
What do you mean, I will get an error but that doesn't matter?
I did this recently with Mandrake and Gentoo, I used the command cp -rp from a Gentoo bootable CD. I had no errors and no problems since. It copies all directories and keep the permissions the same.
In Windows 2000, you can define "volume mount points" which are "used to graft new volumes into the existing file system namespace without requiring the use of a drive letter." In other words, the same volume can reside on more than one physical partition or disk. I believe Linux can do the same with LVM. I have no idea how to use it, but the general concept is still the same- you wouldn't have to copy your partition over, just logically tack additional space onto it. Anyone know how exactly to do this?
I just tried this today myself. I was unable to get it to work either when attempting to copy the partition that my system was booted on. I finally booted with MEPIS (similar to Knoppix) and mounted the two partitions, and copied the populated partition to the empty one, using the method already described.
whats about mounting the new HD and then dd if=/dev/hda of=/dev/hdb and then copying over the MBR if you plan to boot off the second HD. Also, remember to edit your boootloader.
Originally posted by Tyir I get an error message and it just hangs when copying /proc
414M proc
386M proc
Should I worry about this?
I assume you running that OS when you tried that. I would never copy files from a OS that is running, well not when cloning anyway. There will always be files that are locked, in use etc and won't copy. You should do that from a bootable CD to make sure it gets everything.
Also note, copying the files will not copy the bootloader. You will have to install that. You may need to chroot over and install it after you swap the drives and put it like the new setup.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.