FedoraForum.org - Fedora Support Forums and Community
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
  1. #16
    algej Guest
    Quote Originally Posted by Picol
    and at that point, I would have in my VolGroup00 the shrinked LogVol00, a large gap, and then LogVol01 which in this case is my swap partition. With lvdisplay --maps I could find out where LogVol01 is situated physically, but my question is, how do I move LogVol01 "to the left", so to speak? To be able to shrink the logical volume group, after that.
    You open a terminal window and as root,
    Code:
    pvmove --alloc anywhere /dev/sda5:OLDSTARTINGPE-OLDENDINGPE /dev/sda5:NEWSTARTINGPE-NEWENDINGPE
    For example, if lvdisplay --maps showed the following segment for LogVol00:

    --- Segments ---
    Logical extent 0 to 639:
    Type linear
    Physical volume /dev/sda5
    Physical extents 0 to 639

    and the following segment for LogVol01:

    --- Segments ---
    Logical extent 0 to 31:
    Type linear
    Physical volume /dev/sda5
    Physical extents 1544 to 1575

    then pvmove --alloc anywhere /dev/sda5:1544-1575 /dev/sda5:640-671
    would do that. If you have multiple segments per LV you'll have to move them 1 at a time.

    And after that, assuming LogVol01 is 2G in size, and /dev/sda5 is the physical location of the two logical volumes according to lvdisplay, would the following work?

    Code:
    pvresize --setphysicalvolumesize 130G /dev/sda5
    Yes, although you may want to leave a bit of room in there to make snapshots later. 135G would leave room to take 2 x 2G snapshots of the root filesystem with 1G left over. I actually do that prior to running yum update: That way if the update borks my system, I just boot one snapshot and rsync from the other one to the original root filesystem. That quickly and cleanly backs out the update. If you're going to leave LVM on your system, you may as well give yourself a useful configuration.
    Last edited by algej; 14th June 2008 at 04:59 PM.

  2. #17
    yelserp87 Guest
    yea so I am 99% done. I was able to format now my lvm looks like so:

    http://img.photobucket.com/albums/v6...erp87/lvm3.png

    Now my last and final question: How can I format the unused space to something else (ie fat32, ntfs, ext3)? I kinda thought after I did this it would automatically show another drive that would be unpartitioned or something.

    my (partial) fdisk -l shows:

    Code:
    Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1        3825    30724281    7  HPFS/NTFS
    /dev/sdb2            3826        3850      200812+  83  Linux
    /dev/sdb3            3851       30401   213270907+  8e  Linux LVM
    Now is there a way I can get the unpartitioned space to be like sdb4?

    (sdb1 is an 30gb xp install)

  3. #18
    algej Guest
    Quote Originally Posted by yelserp87
    Now is there a way I can get the unpartitioned space to be like sdb4?
    Did you go back in with gparted and see if it would now resize the partition for you?

  4. #19
    yelserp87 Guest
    Whe I went into gprated is showed the hdd:

    dev/sdb
    1 my xp partition
    2 >2gb linux
    3 unknown 200gb lvm

    The only thing different is that in dev/mapper/Vol00 (not typed right) it now shows 100gb instead of 200gb. So my vol00 was shrinked right but I cant find the extra 100gb in gparted.hmmm Maybe I should make the unused 100gb a vol03 or something. Then from there I can format it. Not sure how either way.

  5. #20
    algej Guest
    Assuming GParted now supports LVM, it should allow you to resize /dev/sdb3 to 100G, since your physical volume is only 100G. If GParted refuses to resize it, then instead:

    1. remove the /dev/sdb3 partition.
    2. create a new one in its place, sized to 100G (maybe + a small amount to make sure you don't step on the end of the PV) Make sure you select type "unformatted" or you will destroy your data.
    3. reboot the system.

    Edited for clarity
    Last edited by algej; 14th June 2008 at 09:40 PM.

  6. #21
    yelserp87 Guest
    Will it make a difference if my current lvm looks like so:

    http://img.photobucket.com/albums/v6...erp87/lvm4.png

    From what it looks like if I do the 100gb it may keep the front "os x" partition but kill the rest. Should I just move it to the end?

  7. #22
    algej Guest
    You're looking at the "Logical" view. That has nothing to do with reality. See where it shows "VolGroup00 Physical View"? Open that up, click on sdb3 and show us that screenshot.

  8. #23
    yelserp87 Guest

  9. #24
    algej Guest
    Not quite. You did it once before, right here:

    http://img.photobucket.com/albums/v6...erp87/lvm2.png

    I need to see what partition 3 looks like now.
    Last edited by algej; 14th June 2008 at 11:18 PM.

  10. #25
    algej Guest
    Ah Nevermind. On second look, I see what you've done.

    You created a new logical volume called osx, which fills in the 100G "hole" you created to make room for a new partition, putting you back to square one.

    Unless you've changed your mind and want to keep everything under LVM, then:

    1. Remove the newly-created osx volume. ( lvremove /dev/VolGroup00/osx )

    2. Look at my first post on page 2 (where I explain how to pvmove LogVol01) and move your LogVol01 so that it adjoins LogVol00. Or post the output from lvdisplay --maps and I'll help you with this step.

    3. pvresize --setphysicalvolumesize 100G /dev/sdb3

    At this point, you'll have a 100G physical volume called /dev/sdb3 sitting on a 200G partition also called /dev/sdb3. Then you should be able to launch gparted and resize /dev/sdb3 down to 100G, and create a new 100G partition called /dev/sdb4, and put whatever you want on it.

  11. #26
    Picol Guest
    Hi

    I managed to shrink the physical partition inside the LVM which is sda5. According to fdisk, it is of type "Linux LVM". However, according to fdisk, it is still as big as it was before. Also, there seems to be a partition, sda4, which is just as big, and of type "Extended". According to gparted, sda5 sits inside sda4, and they're both equally big, as big as they were before i resized. GParted wont allow me to resize or remove any of the two partitions either.

    I find it rather strange, because all commands reported success. Have I missed something? How can I shrink the LVM?

    Thanks so much for the help so far!
    Picol

  12. #27
    algej Guest
    Quote Originally Posted by Picol
    Hi

    I managed to shrink the physical partition inside the LVM which is sda5. According to fdisk, it is of type "Linux LVM". However, according to fdisk, it is still as big as it was before.
    Yes, that's correct. You're confusing a physical volume with a partition. They are not the same thing despite having the same name (sda5 in your case). A physical volume is a virtual device containing a series of extents and the metadata describing the state of those extents. Extents are just blocks of data, nothing mysterious about them. However, shrinking a physical volume does nothing to the underlying device (a partition in your case). You must shrink the partition separately.

    Also, there seems to be a partition, sda4, which is just as big, and of type "Extended". According to gparted, sda5 sits inside sda4, and they're both equally big, as big as they were before i resized. GParted wont allow me to resize or remove any of the two partitions either.
    Are you booting the GParted Live CD to do this? As far as I know, gparted wont allow you to resize a mounted partition.

    I find it rather strange, because all commands reported success. Have I missed something? How can I shrink the LVM?
    You *did* "shrink the LVM". Now you're trying to shrink the partition the LVM Physical Volume is sitting on. You can either use gparted Live CD, or if you have the math mojo, you can resize the partition with fdisk. Do this from a rescue CD or a live CD.

  13. #28
    yelserp87 Guest
    2.

    Code:
    [root@localhost ~]# lvdisplay --maps
      --- Logical volume ---
      LV Name                /dev/VolGroup00/LogVol00
      VG Name                VolGroup00
      LV UUID                Z9D1BP-tX6D-qtwS-kpB3-c4KS-O7oB-Nx1QN4
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                100.00 GB
      Current LE             3200
      Segments               1
      Allocation             inherit
      Read ahead sectors     0
      Block device           253:0
       
      --- Segments ---
      Logical extent 0 to 3199:
        Type                linear
        Physical volume     /dev/sdb3
        Physical extents    0 to 3199
       
       
      --- Logical volume ---
      LV Name                /dev/VolGroup00/LogVol01
      VG Name                VolGroup00
      LV UUID                kIIVhQ-Beev-rS8N-kNcX-9hGH-ctPH-BiBGuC
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                1.94 GB
      Current LE             62
      Segments               1
      Allocation             inherit
      Read ahead sectors     0
      Block device           253:1
       
      --- Segments ---
      Logical extent 0 to 61:
        Type                linear
        Physical volume     /dev/sdb3
        Physical extents    6445 to 6506

  14. #29
    algej Guest
    Yelserp87,

    As root, run

    pvmove --alloc anywhere /dev/sdb3:6445-6506 /dev/sdb3:3200-3261
    Last edited by algej; 16th June 2008 at 04:13 PM.

  15. #30
    yelserp87 Guest
    Ok did that. It made it to 100%. Now I am on step 3. This is my output:

    Code:
    [root@localhost ~]# pvresize --setphysicalvolumesize 100G /dev/sdb3
      /dev/sdb3: cannot resize to 3199 extents as 3262 are allocated.
      0 physical volume(s) resized / 1 physical volume(s) not resized
    Should I try something lower like 95G?

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Shrinking partition with Fedora
    By helphelphelp in forum Using Fedora
    Replies: 2
    Last Post: 3rd July 2009, 07:56 AM
  2. Fedora 10 + partition shrinking + dual boot ubuntu
    By DaveVentresca in forum Installation, Upgrades and Live Media
    Replies: 1
    Last Post: 11th March 2009, 07:43 PM
  3. Shrinking a partition that is managed by LVM?
    By unclestoner666 in forum Using Fedora
    Replies: 28
    Last Post: 15th August 2008, 04:42 AM
  4. Shrinking a partition
    By crossmr in forum Using Fedora
    Replies: 5
    Last Post: 15th June 2006, 11:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •