LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 08-12-2005, 05:33 AM   #1
linuxmandrake
Member
 
Registered: Sep 2004
Distribution: debian sarge 64bit (AMD)
Posts: 709

Rep: Reputation: 30
Resizing partitions to install xp


My LVM for FC3 takes up too much space hence I dont have any space left to install windows xp. How do I resize it?
 
Old 08-12-2005, 05:44 AM   #2
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 49
QTParted will do the work, it is a nice partitioner with a GUI. You may also boot with some distro CD and just do the parition part, but not every partitioner will support resizing w/o losing the data.
 
Old 08-12-2005, 06:01 AM   #3
linuxmandrake
Member
 
Registered: Sep 2004
Distribution: debian sarge 64bit (AMD)
Posts: 709

Original Poster
Rep: Reputation: 30
I have tried qtparted, FC3 installation program, partiton commander. They all wont let me rezise the stupid LVM. They all display it as an unrecognised partition

Last edited by linuxmandrake; 08-12-2005 at 06:35 AM.
 
Old 08-12-2005, 09:19 AM   #4
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 49
Oh, sorry I missed that you were talking about LVM. I tried that a month ago myself but did not find anything. And since I was not in the mood to find anything I just erased everything and skipped LVM :P

btw, I found this link after doing a little Googling: http://linux.msede.com/ext2/
If you don't find anything useful I suggest that you subscribe to the lvm mailing list. Those people over there should be abe to help you or point you in the right direction.

Good luck!

Last edited by Ephracis; 08-12-2005 at 09:23 AM.
 
Old 08-12-2005, 10:15 AM   #5
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
It’s easy to resize the logical volume(s), but it may not be possible to resize the physical volume (i.e., the partition(s)) at this time, since the LVM command pvresize has not been implemented yet.

If I were going to do what you need to do on one of my systems, I would (1) copy everything in the logical volumes(s) to another drive (e.g., an external USB drive) or to a different partition on the current drive, (2) remove and recreate the LVM and then (3) copy everything back to the recreated LVM.

But before I removed the LVM, I would try reducing the logical volume(s) size(s) and then attempt to resize the partition by deleting it in fdisk and repartitioning it at a smaller size (but larger than the logical volume(s), just as a safety precaution). I don’t know whether the LVM physical volume assignment will survive the repartitioning.

For more information about resizing a logical volume, look at the LVM HowTo in chapter 11 “Common Tasks”, subsection 11.10 “Reducing a logical volume” ( http://www.ibiblio.org/pub/Linux/doc....html#reducelv ) in the ext2-LVM2 description. It’s a little cryptic, but the man pages explain the commands in detail.

Remember, you need to reduce the size of the ext3 filesystem before you reduce the size of the logical volume. I usually make the ext3 filesystem a little smaller than the desired logical volume size and then resize/grow it to fill the resized logical volume.


Is today the day you order the external USB drive that you have been thinking about buying?
 
Old 08-12-2005, 01:42 PM   #6
linuxmandrake
Member
 
Registered: Sep 2004
Distribution: debian sarge 64bit (AMD)
Posts: 709

Original Poster
Rep: Reputation: 30
Ok i get you but could u tell me what commands i need to use because am a ameteur. I dont have a clue
 
Old 08-12-2005, 02:36 PM   #7
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Hey, I’m a linux amateur, too. There’s certainly a lot more that I don’t know about linux than I do know about it. The ratio is probably around 20:1::Don’t:Do, if not worse than that.

Let’s start with the backup. Where do you plan to copy the contents of current logical volume to and is it already formatted with enough space to hold your stuff?

The “where” options could be another partition on the same drive, another local PATA/SATA drive, an external drive like a USB 2.0 drive (but not on a USB 1.1 connection) or a network drive on your LAN, provided you have at least a 100Mbps LAN.
 
Old 08-12-2005, 03:58 PM   #8
linuxmandrake
Member
 
Registered: Sep 2004
Distribution: debian sarge 64bit (AMD)
Posts: 709

Original Poster
Rep: Reputation: 30
Well I have got myself a new SATA so I could use windows while am sorting out my LVM stuff. Copying it to that would be logical and ideal since you're not suppsoed to keep orginal data and backups on the same hard drive.

Any help would be greatly appriciated. Am very close to pulling my hair out.
 
Old 08-12-2005, 06:02 PM   #9
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Everything you will be doing will be from FC3 Rescue mode (i.e., boot: linux rescue). When you reach the “search for FC installations” question, answer No, since the current partition really should be unmounted when you copy it. Normally, I suggest Knoppix for doing “rescue” things, but it is not currently LVM aware. What a pain!

If anyone sees an error below or has a better way to do something, be sure to say something. I won’t be offended. Also, if something isn’t clear, you can always look at the man pages (e.g. man lvscan) for more details.

1) Using fdisk in rescue mode, create a partition on the new SATA drive that is big enough to hold your stuff by running:

fdisk /dev/sdb

assuming that the new drive will be the second SATA drive. If you have other SATA drives, adjust the sdx to the correct letter.

Create a new primary partition (“n”) starting at the beginning. There is a menu (“m”) that lists the commands in fdisk. When it ask for the ending cylinder, it will display how to enter a size in MB, so follow the suggestion and enter the number of MB you want. Remember, 1024MB=1GB. When you are done, write (“w”) the setup to exit. If you enter “q”, it will exit and discard your modifications.

2) Create a simple ext3 filesystem by running:

mke2fs -j /dev/sdb1

assuming that the new partition will be sdb1.

3) Create some simple mountpoints for the old and new partitions by running:

mkdir /mnt/in
mkdir /mnt/out

Not very creative, but you won’t forget what they are for.

4) You need to activate the LVM by running this series of commands:

lvm vgscan
lvm lvscan
lvm vgchange -a y
lvm lvscan

The last one should show your logical volume as an active logical volume. In theory, you should only need to run the vgchange part, but sometimes the first two lines are essential.

5) Mount the partitions, where I will assume that your logical volume is named “/dev/VolGroup00/LogVol00" (the last lvscan will print out the actual name):

mount /dev/VolGroup00/LogVol00 /mnt/in
mount /dev/sdb1 /mnt/out

6) Make an archival copy from one drive to the other:

cp -a /mnt/in/* /mnt/out

It will take a while. I usually do this with rsync, but it isn’t available in rescue mode. When it’s done copying, /mnt/out should look just like /mnt/in. If for some reason you stop the copy and want to restart it, use:

cp -af /mnt/in/* /mnt/out

Otherwise, you will have to confirm each overwrite of anything already written to the filesystem.

7) Unmount the partitions:

cd /
umount /mnt/in
umount /mnt/out

8) Remove the old logical volume, the volume group and the physical volume, which you will recreate later:

lvm lvremove /dev/VolGroup00/LogVol00
lvm vgremove VolGroup00
lvm pvremove /dev/sda.......

lvm lvscan
lvm vgscan
lvm pvscan

where you need to provide the correct partition # in the pvremove step. The ..scan steps are just to confirm that they are gone.

9) Delete the old partition and make a new, smaller one:

fdisk /dev/sda

assuming the old disk is /dev/sda. Print (“p”) the partitions and write down the partition number, starting cylinder and ending cylinder for the old physical volume. Then delete it and create a new partition with the same partition number and starting at the original cylinder, but with an end point in MB that is the size you want. Now change the partition type (“t”) to 8e, which is “Linux LVM”. When you are done, write (“w”) the setup to exit fdisk.

10) Recreate the LVM:

lvm pvcreate /dev/sda...
lvm vgcreate -s 32M VolGroup00 /dev/sda...
lvm lvcreate -L 10G -n LogVol00 VolGroup00
lvm lvscan

where you need to use the correct partition in the first step. Be sure to reuse the same volume group and logical volume names. Otherwise, you will need to modify grub.conf and fstab to get the system to boot.

What you have done is to make /dev/sda... a physical volume, created a volume group named VolGroup00 with 32MB physical extents on the physical volume and created a 10GB logical volume named LogVol00 in the volume group.

The 10GB size is just for demonstration purposes, so use the actual size you want. I would suggest leaving about 10% of the volume group as space free, so that you could us something called a logical volume snapshot in the future, which is very helpful when making backups.

11) Format the new logical volume as ext3:

mke2fs -j /dev/VolGroup00/LogVol00

12) Mount the partitions:

mount /dev/sdb1 /mnt/in
mount /dev/VolGroup00/LogVol00 /mnt/out

13) Restore the contents by making an archival copy of the backup:

cp -a /mnt/in/* /mnt/out

Look familiar? When it’s done, look around /mnt/out and see if it looks correct.

14) Close up shop and try it out:

cd /
umount /mnt/in
umount /mnt/out
exit

Keep giving “exit” until it finally shuts down.

Now boot it up and see what happens.

Last edited by WhatsHisName; 08-12-2005 at 06:10 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resizing linux partitions to free up space for window$ - safe or clean install? dianat100 Linux - Newbie 5 03-09-2005 12:05 PM
Resizing partitions jaakkop Fedora 2 09-30-2004 08:33 AM
Moving and resizing partitions to install Windows IBBoard Linux - General 11 08-03-2004 09:50 AM
Resizing partitions after install Nerd2 Linux - Hardware 4 05-07-2003 12:59 AM
resizing partitions suselinux Linux - General 7 09-07-2001 07:28 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration