Find the answer to your Linux question:
Results 1 to 5 of 5
I installed Debian Wheezy testing, and the installation wen't pretty smoothly, except for one thing. When I booted my computer, the swap LV I created didn't appear under file systems ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2012
    Posts
    2

    Swap LV not detected, no swap partition


    I installed Debian Wheezy testing, and the installation wen't pretty smoothly, except for one thing. When I booted my computer, the swap LV I created didn't appear under file systems in System Monitor and no swap was found under Resources.

    When I installed, I did so over an old installation of Debian 6, and I deleted the data on the swap partition, I didn't need to but since I was already reformatting all the LVs I though I might as well delete everything. There was an error, I can't remeber what it said, relating to the swap partition, but it gave me no obvious options and it didn't seem to be a big deal, so I continued on with installation.

    When I booted I tired to use my Swap LV as swap space, by following the first two answers in "askubuntu(dot)com/questions/33697/adding-swap-partition-after-system-installation". But niether attempt at setting the Swap LV as a the swap space in fstab worked.

    I should note that although the swap LV doesn't appear in system monitor, I can find it just fine with fdisk -l

    Code:
    Disk /dev/mapper/Cosmo-swap_1: 7998 MB, 7998537728 bytes
    255 heads, 63 sectors/track, 972 cylinders, total 15622144 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/mapper/Cosmo-swap_1 doesn't contain a valid partition table
    Although I can't use my swap LV, I was able to create a swap file in /home (I'm not using any of it, but heard that the Kernel likes having swap space at hand). I followed "askubuntu(dot)com/questions/126018/adding-a-new-swap-file-how-to-edit-fstab-to-enable-swap-after-reboot" to create the swap file, although my OS doesn't use any of it.

    Is there any problems with setting up a swap file like this? Does a Swap file present any performance decrease over a dedicated swap partition or swap LV?
    Is there anything else I must do, beside creating fstab and running sudo blkid /dev/mapper/Cosmo-swap_1, to make my OS realize swap_1 is my swap LV?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    Sorry, but other than the directive that you should NEVER place swap on a LV, I don't know. A swap volume (vs. a swap file) should ALWAYS be on a raw disc partition. You can use a logical volume file system to contain ancillary swap files, but your primary swap space should be raw disc space.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jun 2012
    Posts
    2
    Quote Originally Posted by Rubberman View Post
    A swap volume (vs. a swap file) should ALWAYS be on a raw disc partition.
    I didn't know that, I based my LV structure on the automatic one, that made a Swap LV.

    Fortunetly in my disk partition structure, I left some unallocated space at the end of the drive I could put to a dedicated swap partition.

    Thanks.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    Quote Originally Posted by wagweaver View Post
    I didn't know that, I based my LV structure on the automatic one, that made a Swap LV.

    Fortunetly in my disk partition structure, I left some unallocated space at the end of the drive I could put to a dedicated swap partition.

    Thanks.
    Yeah. I installed a RHEL 5.8 system on a virtual machine the other day, and I noticed that they put the swap on an LVM as well, though RHEL 6.x and clones don't. Go figure... I personally using a physical swap partition, probably because I'm just an old-fashioned kind of dude who doesn't think that someone else should make all my decisions for me.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,304
    Hi, Rubberman.
    Quote Originally Posted by Rubberman View Post
    Yeah. I installed a RHEL 5.8 system on a virtual machine the other day, and I noticed that they put the swap on an LVM as well, though RHEL 6.x and clones don't ...
    Code:
    /dev/mapper/vg_vmcentos-lv_root           /        ext4   defaults       1 1
    UUID=3e1a9686-a46d-4a20-a0ef-d810d939a696 /boot    ext4   defaults       1 2
    /dev/mapper/vg_vmcentos-lv_swap           swap     swap   defaults       0 0
    tmpfs                                     /dev/shm tmpfs  defaults       0 0
    devpts                                    /dev/pts devpts gid=5,mode=620 0 0
    sysfs                                     /sys     sysfs  defaults       0 0
    proc                                      /proc    proc   defaults       0 0
    The system is:
    Code:
    $ version =o
    OS, ker|rel, machine: Linux, 2.6.32-71.29.1.el6.i686, i686
    Distribution        : CentOS Linux release 6.0 (Final)
    So some recent RHEL clones seem to make swap LVs ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

Posting Permissions

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