Increasing swap space on a Fedora/LVM system


Results 1 to 7 of 7

Thread: Increasing swap space on a Fedora/LVM system

  1. #1
    Join Date
    May 2003
    Posts
    4

    Increasing swap space on a Fedora/LVM system

    I have installed Fedora Core 5 on a system with 2 HDDs. I took the default space allocation which, with the exception of the boot partition, put both physical drives in one logical volume.

    Now I am trying to install Oracle 10g and it is telling me I don't have enough swap space. I've searched here (and elsewhere) for a solution but I'm still not sure of how to increase my swap space under a LVM setup.

    Any help would be appreciated.

  2. #2
    Join Date
    May 2003
    Posts
    4
    I continue to research a solution while waiting on someone with more experience to hopefully provide some direction.

    I've found an article here discussing LVM to some degree. There is a section about reducing the size of a logical volume and that is what I need to do since all of my HD space is allocated (no spare room to increase swap space).

    Problem is that this HOWTO covers reducing ext2 systems while my space is allocated as ext3. Do the ext2 tools work on ext3?

    Also, I've got a "Logical Volume Management" tool that came along with the Core 5 s/w. It provides both a logical and physical view of my drives and even has an interface where you can adjust sizes. I haven't found any documentation on it yet, so I don't know if I were to use this tool to reallocate space if it would insulate me from potential data loss by shrinking the fs in the background prior to reducing the size of my ext3 extent. Does anyone know the answer to this question or where I can find definitive documentation on this tool?

    Again, thanks in advance for any help.

  3. #3
    Join Date
    Sep 1999
    Posts
    3,202
    dd if=/dev/zero of=/some/path/to/a/file bs=1M count=500
    mkswap /some/path/to/a/file
    swapon /some/path/to/a/file


    And of course, edit /etc/fstab to add yoru new swap entry so it will show up on boot

  4. #4
    Join Date
    May 2003
    Posts
    4
    Thanks for your advice. I was, however, in the middle of a Knoppix solution, I suppose, when you posted this.

    I'll post what I did to solve my problem. However, for those of you looking for a solution to a similar problem, I must caution you that I am not a Linux administrator (just trying to get enough swap space for Oracle 10g), and I am working on a brand new Fedora Core 5 system, non-production, and w/o user data. Therefore, I could risk having a somewhat cavalier attitude when it came to potential data loss.

    I found this discussion on one of the forums. I pretty much following the steps given...

    I downloaded the newest Knoppix (what a great tool), 5.0.1 I believe, and booted. Then like the post above
    1 - vgchange -a y /dev/VolGroup00/LogVol00
    2 - e2fsck /dev/VolGroup00/LogVol00
    (I got some msg here saying the last write time was in the future - I chose not to fix it. As a result, I suppose, it told me "contains a filesystem with errors, check forced". However, each of the steps passed, so I didnt' worry about things. Figured it was a timestamp problem - maybe system clock wasn't set right or something.)
    3 - resize2fs -p /dev/VolGroup00/LogVol00 365G
    (I was resizing the volume group down by 5GB - just needed a couple of more GB of swap space. Unlike the discussion in the script I was following, my resize went very quick - about 3 mintues)
    4 - lvreduce -L365G /dev/VolGroup00/LogVol00
    5 - lvm tool in Knoppix: used lvresize to make /dev/VolGroup00/LogVol01 4GB
    (this is my swap partition)

    Once I rebooted Fedora, everything was fine.

    I do wish, much like the discussion in the link above, that I wouldn't have taken the defaults in the Fedora install. Life would have been easier. If you follow that discussion all the way through, you'll see a responder saying that the system-config-lvm tool in Core 5 would handle everything for you. However, since my logical volume was '/', I could not access it w/o the help of Knoppix. Plus, it seems that the swap volume from Fedora presented a problem too. Once again, Knoppix was invaluable.

    I post this set of "procedures" simply for your reference. I would not advise following them if you are on a production system or can't risk loosing data. I am not a system admin, but had nothing to loose in trying, and they worked for me. Maybe someone with more knowledge will refine them, if appropriate, for those of you in more dire need.

    Now off to get Oracle 10g installed.....
    Last edited by ageofempires; 06-14-2006 at 08:36 PM.

  5. #5
    Join Date
    Jul 2006
    Posts
    2

    A question?

    Hello ageofempires,

    I had the same issue with the default Fedora 5 partitions. Initially, I have 256MB memory so the swap partition is 512MB. Later I increased the memory to 1GB.

    By following your steps, I successfully increased the swap partion to 4GB. It can be verified from the GUI interface in "System/Administration/Logical Volume Management."

    However, it seems that Fedora still recognizes 512MB swap size, as from the "df -h" and "top" command.

    How should I address this issue? I am relatively new to Fedora/Linux.

    [jcheng@localhost etc]$ df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
    83G 4.9G 75G 7% /
    /dev/sda1 99M 15M 80M 16% /boot
    tmpfs 500M 0 500M 0% /dev/shm
    /dev/sda2 57G 687M 54G 2% /home

    [jcheng@localhost etc]$ top
    ......
    Mem: 1023324k total, 584008k used, 439316k free, 135156k buffers
    Swap: 524280k total, 0k used, 524280k free, 263684k cached


    [jcheng@localhost etc]$ cat /etc/fstab
    /dev/VolGroup00/LogVol00 / ext3 defaults 1 1
    LABEL=/boot /boot ext3 defaults 1 2
    devpts /dev/pts devpts gid=5,mode=620 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    LABEL=/home /home ext3 defaults 1 2
    proc /proc proc defaults 0 0
    sysfs /sys sysfs defaults 0 0
    /dev/VolGroup00/LogVol01 swap swap defaults 0 0


    Thanks,
    Jim

  6. #6
    Join Date
    May 2003
    Posts
    4
    I would love to give you the answer to your question, but unfortunately, I am new to Fedora too. I installed it simply to get a Linux installation of Oracle going. I don't know much about Fedora itself.

    I do know that after I posted the above, I found, like you, that the system showed my increased size (therefore, I THOUGHT it was working correctly on my last post), but I had to do something else to actually get the system to use that extra space after it was allocated. I guess I forgot to come here and update things, and unfortunately I've forgotten what I did. I apologize I don't have the extra step and I certainly hope someone else with more experience than I will chime in and answer your question.

    I don't believe it was the "swapon" command that did the trick, but you may want to research this command and see if it helps.

    If I do recall what I did, I certainly will update here for your reference.

    Hope you get everything worked out!

  7. #7
    Join Date
    Jul 2006
    Posts
    2

    thanks

    I used the command mkswap. After rebooting the computer, it seems to recognize 4G swap partition.

    [jcheng@localhost ~]$ cat /proc/swaps
    Filename Type Size Used Priority
    /dev/mapper/VolGroup00-LogVol01 partition 4194296 0 -1

    [jcheng@localhost ~]$ top
    ...
    Mem: 1023324k total, 343412k used, 679912k free, 14724k buffers
    Swap: 4194296k total, 0k used, 4194296k free, 230976k cached
    ...


    Regards,
    Jim

Posting Permissions

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