Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Permanently delete swapfile?

  1. #1
    Join Date
    Mar 2011
    Location
    Oceanside
    Beans
    427
    Distro
    Ubuntu 11.04 Natty Narwhal

    Permanently delete swapfile?

    I have a swap partition and I would like to delete the swapfile setting that is a leftover from the install. I can turn it off using the dphys-swapfile swapoff command but it returns after a boot.

    dan@dan-AOD255://var$ swapon -s
    Filename Type Size Used Priority
    /dev/sda6 partition 5119996 0 -1
    /var/swap file 2097148 0 -2
    Dan
    I wish my computer would do what I wanted it to do instead of what I told it to do.

  2. #2
    Join Date
    Oct 2008
    Location
    kentucky
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Permanently delete swapfile?

    um i don't think you can get rid of it as it is a partition. maybe you can resize it and make it smaller. but if you do get rid of it expect problems later. no hibernate. oh and if your run out of ram Im not sure what will happen
    DELL XPS m1530, Intell core 2 duo T9500 @ 2.6GHz, 4gig ram, 8600GTm

  3. #3
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: Permanently delete swapfile?

    Look in /etc/fstab and comment it out and see what happens.

  4. #4
    Join Date
    Mar 2011
    Location
    Oceanside
    Beans
    427
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Permanently delete swapfile?

    I want to get rid of the file not the partition. The entry in fstab is for the partition that I want to keep.

    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc nodev,noexec,nosuid 0 0
    UUID=dd029b11-e1e0-4b3e-a0e5-3f7518e07ab5 / ext4 errors=remount-ro,user_xattr 0 1
    /dev/sda6 none swap sw 0 0
    /dev/sda7 /home2 ext4 defaults 0 2

    I want to use sda6 for swap space.




    dan@dan-AOD255:/var$ ls -l swap*
    -rw------- 1 root root 2147483648 2011-03-16 18:36 swap

    I want to get rid of this file.
    Dan
    I wish my computer would do what I wanted it to do instead of what I told it to do.

  5. #5
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: Permanently delete swapfile?

    Oh, you didn't make that very clear.

    Code:
    sudo rm -rf /var/swap

  6. #6
    Join Date
    Mar 2011
    Location
    Oceanside
    Beans
    427
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Permanently delete swapfile?

    Quote Originally Posted by wojox View Post
    Oh, you didn't make that very clear.

    Code:
    sudo rm -rf /var/swap

    I tried that.

    rm: cannot remove `/var/swap': Operation not permitted
    Dan
    I wish my computer would do what I wanted it to do instead of what I told it to do.

  7. #7
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: Permanently delete swapfile?

    Code:
    sudo su
    Code:
    rm -rf /var/swap

  8. #8
    Join Date
    Mar 2011
    Location
    Oceanside
    Beans
    427
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Permanently delete swapfile?

    Quote Originally Posted by wojox View Post
    Code:
    sudo su
    Code:
    rm -rf /var/swap

    dan@dan-AOD255:/var$ sudo su
    [sudo] password for dan:
    root@dan-AOD255:/var# rm -rf /var/swap
    rm: cannot remove `/var/swap': Operation not permitted
    Dan
    I wish my computer would do what I wanted it to do instead of what I told it to do.

  9. #9
    wojox is offline I Ubuntu, Therefore, I Am
    Join Date
    Apr 2009
    Beans
    8,628

    Re: Permanently delete swapfile?

    Did you disable swap before trying?

  10. #10
    Join Date
    Mar 2011
    Location
    Oceanside
    Beans
    427
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Permanently delete swapfile?

    Quote Originally Posted by wojox View Post
    Did you disable swap before trying?

    I thought I did. It works better with swap disabled. Now will the file get recreated after a boot. Or will the computer complain because it's not there now. Only one way to find out. Back in a minute.
    Dan
    I wish my computer would do what I wanted it to do instead of what I told it to do.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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