Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 15th June 2006, 05:45 AM
crossmr Offline
Registered User
 
Join Date: Dec 2005
Location: Canada
Age: 34
Posts: 276
Shrinking a partition

I need to shrink the partition on my laptop to create an additional partition of about 15 GB.
I know how to expand an existing partition if there is free unallocated space after it, but I'm not sure how to shrink my partitoin. My HD is as follows:
/dev/sda1 boot start: 1 end: 13 blocks: 104391 ID: 83 System: Linux
/dev/sda2 start: 14 end: 4864 blocks 38965657+ ID: 8e System Linux LVM


I thought I remembered setting it up with a swap partition but I guess not. Maybe that was my desktop.
sda2 is nowhere near full (28 GB free). I have a kanotix live CD with QT parted on it, but when I boot with it, it detects this, but resize is greyed out.
Anyway I can go about resizing this?
Reply With Quote
  #2  
Old 15th June 2006, 06:38 AM
zephlyn Offline
Registered User
 
Join Date: Sep 2004
Location: Columbus, OH
Posts: 55
You may want to read up on LVM=> http://www.tldp.org/HOWTO/LVM-HOWTO/

Your swap and your / partition are most likely logical volumes within the LVM partition. You can't resize an LVM partition using QTparted. Everything you need should be available through LVM. However, it could get a little tricky because you are most likely going to need to reduce the size of the / partition logical volume and I'm not sure if you can do that while it is mounted because you will need to reduce the size of the file system underneath it. That means you will probably need to boot from the Fedora Recover CD to perform the filesystem resize and LVM work from a command line.

As always--backup your data before playing with paritions or logical volumes
Reply With Quote
  #3  
Old 15th June 2006, 06:48 AM
crossmr Offline
Registered User
 
Join Date: Dec 2005
Location: Canada
Age: 34
Posts: 276
wow thats a huge howto.
I was expecting I'd have to use Kanotix or some other LiveCD to do the work from. No worries there. I'll start digging through this. If I get confused I'll be back
Reply With Quote
  #4  
Old 15th June 2006, 06:34 PM
crossmr Offline
Registered User
 
Join Date: Dec 2005
Location: Canada
Age: 34
Posts: 276
This is an output from my lvmdiskscan The big 35 GB partition I'm assuming is my main HD, the 1.9 GB piece is that possibly my swap?
Code:
[root@crossmr ~]# lvmdiskscan
  /dev/ramdisk [       16.00 MB]
  /dev/dm-0    [       35.19 GB]
  /dev/ram     [       16.00 MB]
  /dev/sda1    [      101.94 MB]
  /dev/dm-1    [        1.94 GB]
  /dev/ram2    [       16.00 MB]
  /dev/sda2    [       37.16 GB] LVM physical volume
  /dev/ram3    [       16.00 MB]
  /dev/ram4    [       16.00 MB]
  /dev/ram5    [       16.00 MB]
  /dev/ram6    [       16.00 MB]
  /dev/ram7    [       16.00 MB]
  /dev/ram8    [       16.00 MB]
  /dev/ram9    [       16.00 MB]
  /dev/ram10   [       16.00 MB]
  /dev/ram11   [       16.00 MB]
  /dev/ram12   [       16.00 MB]
  /dev/ram13   [       16.00 MB]
  /dev/ram14   [       16.00 MB]
  /dev/ram15   [       16.00 MB]
  2 disks
  17 partitions
  0 LVM physical volume whole disks
  1 LVM physical volume
So it seems if I use resize2fs /dev/dm-0 15G
this will reduce the file system by 15GB.
Then if I run
lvreduce -L-15G /dev/dm-0

it should free up 15 GB. What is done with the 15 GB at that point? Is it still being kept within the LVM, do I need to further tell it somehow to release that space so its considered "unpartitioned" or does it do that automagically?

[edit] So when I'm in Kanotix and lvmdiskscan I get a completely different output and it just shows /dev/sda2 and not the /dev/dm-0 partition.

Last edited by crossmr; 15th June 2006 at 07:00 PM.
Reply With Quote
  #5  
Old 15th June 2006, 09:42 PM
zephlyn Offline
Registered User
 
Join Date: Sep 2004
Location: Columbus, OH
Posts: 55
lvmdiskscan List devices that could be used as physical volumes. Your / and your swap are most likely logical volumes within the existing LVM partition.

Boot into your system normally. su to root. Go into the lvm shell by typing in lvm at the command prompt. Issue an lvscan at the lvm> prompt to see your logical volumes. You can also issue a help command at the lvm> prompt to see all the available commands.

Depending on what you need the 15 GB partition for you could do it one of a couple different ways. If you need the 15 GB partition while running under Linux then you could simply create another logical volume within the existing LVM partition once you get the / partition resized. If you need the new 15 GB outside of Linux then you will still need to reduce the size of the LVM physical volume so there will be enough room to create a regular disk partition.

Since this is your first time I recommend setting up another LVM on a test machine or an external USB drive and playing with it that way.
Reply With Quote
  #6  
Old 15th June 2006, 11:08 PM
crossmr Offline
Registered User
 
Join Date: Dec 2005
Location: Canada
Age: 34
Posts: 276
well I need the 15 gb as a separate partition to install Vista Beta 2 on. I'm going to an MS event in a week and a half (yeah yeah I know). Part of the event is them giving everyone copies and installing it there at the event on a machine you bring. I realize it will be full of propoganda and such, but there may be free food.

Unfortunately I don't have any machines I can mess around with lvm on, so I think I'm going to have to go for it and hope for the best My laptop isn't critical right now, so if I waste a day putting FC5 back on it because I mess it up, its not the end of the world. If you can think of any threads or sites that give an example walkthrough of the procedure I'd greatly appreciate it.

Last edited by crossmr; 15th June 2006 at 11:13 PM.
Reply With Quote
Reply

Tags
partition, shrinking

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shrinking partition with Fedora helphelphelp Using Fedora 2 3rd July 2009 07:56 AM
Fedora 10 + partition shrinking + dual boot ubuntu DaveVentresca Installation and Live Media 1 11th March 2009 07:43 PM
Shrinking a partition that is managed by LVM? unclestoner666 Using Fedora 28 15th August 2008 04:42 AM
shrinking lvm partition usuing gparted yelserp87 Using Fedora 30 16th June 2008 08:56 PM


Current GMT-time: 20:33 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat