Find the answer to your Linux question:
Results 1 to 10 of 10
Well I need to make a swapfile Since when I do emerge (Gentoo) it says it doesnt have Enough Virtual memory. I cant make a Swap Partition. So I thought ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429

    root isnt allowed to make swapfile?


    Well I need to make a swapfile
    Since when I do emerge (Gentoo) it says it doesnt have Enough Virtual memory.
    I cant make a Swap Partition. So I thought Id make a swap file.
    I knew how to do it, but I did check it with google looking here: GNU/Linux - Adding Swap Space on the Fly in Linux

    I found out I made one small Mistake (not chmodding) but still after that I am not allowed to turn swap on when I do:
    swapon /swapfile
    I just get:
    swapon: swapfile: Operation not permitted.
    So, how can this been done?
    I really need this swap file since I want to remerge something badly.

    Cheers,
    Robin
    New Users, please read this..
    Google first, then ask..

  2. #2
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Are you trying to run swapon on a directory or is that a typo? What's the name and location of the file you're trying to use for swap?

  3. #3
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    the file name is swapfile
    and its located in root so /
    thats why i did /swapfile
    I tryed also without the Slash.
    Doesnt work either.
    New Users, please read this..
    Google first, then ask..

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    What's the output of ls -l?

  6. #5
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    The list of my root. ^^ (/etc /home etc)

    And the output of

    ls -l | grep swapfile is
    -rw--------- 1 root root 135379968 Nov 26 14:52 swapfile
    New Users, please read this..
    Google first, then ask..

  7. #6
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    And the mkswap command was successful? Then I'm stumped. It might be best to delete the file and start again from scratch to be sure the steps are done in correct order.

  8. #7
    Just Joined!
    Join Date
    Nov 2007
    Location
    Camp Pendleton
    Posts
    55
    Is there something different about your configuration? You're not running any virtualization are you? (Xen or something else?)

    Please send the contents of /etc/fstab...

  9. #8
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    Quote Originally Posted by Thrillhouse View Post
    And the mkswap command was successful? Then I'm stumped. It might be best to delete the file and start again from scratch to be sure the steps are done in correct order.
    Well I was Stumped as well.. I did it about 5 times now. And yet still Unsuccessful and the swap is made successfully.

    Quote Originally Posted by mrjohnson
    Is there something different about your configuration? You're not running any virtualization are you? (Xen or something else?)

    Please send the contents of /etc/fstab...
    I am running in OpenVZ. But that shouldnt matter.
    What does /etc/fstab to do with this? I am not trying to turn swap on during boot..

    Anyhow Ill drop it for you anyhow:
    Code:
    proc /proc proc defaults 0 0
    New Users, please read this..
    Google first, then ask..

  10. #9
    Just Joined!
    Join Date
    Nov 2007
    Location
    Camp Pendleton
    Posts
    55

  11. #10
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,429
    Thanks a lot...
    New Users, please read this..
    Google first, then ask..

Posting Permissions

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