turn off swap and gain 1GB of disk space

Discussion in 'Linux' started by sailor070, Aug 2, 2008.

  1. sailor070


    Aug 2, 2008
    Likes Received:
    Remove swap and gain 1GB storage

    Having swap on a SSD seems not a too good idea, see also AA1 section on archlinux.org. Nevertheless, Acer decided to have swap anyway. Some believe that 512MB of RAM would not be enough w/o swap, that's arguable. However, the EeePC701 does not make use of swap w/ having the same amount of RAM. As a side remark, to be honest, both netbooks I upgraded to max RAM.

    Here's my way of getting swap deactivated:

    get a terminal: (Documents -> File -> Terminal)
    for convenience, get a root-concole: type "sudo xterm &"

    in the root-console:
    /sbin/swapoff /dev/sda2

    Now you need to edit /etc/fstab were it reads "/dev/sda2 swap swap default 0 0". If you would like to have extra space for data, the line could look like this: "/dev/sda2 /mnt/data ext2 defaults,noatime 1 2". If you go for this option, return to the root-console and perform the following commands:

    /sbin/fdisk /dev/sda (in fdisk type: "t" "2" "83" "w" (w/o quotation marks); this changes the partition type of /dev/sda2 to "Linux", writes the partition table and quits fdisk)

    mkdir /mnt/data
    /sbin/mke2fs /dev/sda2
    mount /dev/sda2 /mnt/data

    Essentially you're done by now. Since the partition is listed in the fstab, it will be mounted during boot.
    You gained 1GB of data storage, and even better, did something good for your SSD. This all can be done w/o any additional software, it's all provided in the original install made by Acer.

    Alternatively (that's what I did finally) you could delete the partition /dev/sda2 and resize /dev/sda1. However, this requires that you have the means to boot another Linux from an external medium. I used a liveCD having "gparted" on it. Since this seems to be a solution for the more advanced user, I will leave it to the reader to reach out for his own preferred liveCD.
    Some hints how to do this can be found on http://www.tldp.org/LDP/Mobile-Guide/html/mobile-guide-p1c3s3-linux-tools-to-repartition.html.

    Happy hackin', Sailor070
    sailor070, Aug 2, 2008
    1. Advertisements

  2. sailor070


    Aug 2, 2008
    Likes Received:
    I am running Ubuntu on my 'one' and have done the same thing. Originally I had the swap partition but, after seeing similar advice like this, I deleted the partition and expanded the root partition to use the new space.

    Like sailor070, I have expanded the RAM to 1.5GB but I did run this way at 512 MB for a short while without issue.
    OzCDN, Aug 2, 2008
    1. Advertisements

  3. sailor070


    Jul 17, 2008
    Likes Received:
    jeromlenz, Aug 2, 2008
  4. sailor070


    Jul 22, 2008
    Likes Received:
    UK - (most locations)
    OK I added the ram (now 1.5gig) swap is off, and I made sure it stays that way.

    I am having some fun with various usb memory sticks, they don't seen to want to boot (it is set in the bios).
    Once I get that sorted I will as per instructions, get rid of the old swap partition.

    Linpus doesn't seem to consume too much ram, nice and efficient.

    Thanks for the helpful posts.
    Sid, Aug 2, 2008
  5. sailor070


    Jul 17, 2008
    Likes Received:
    I followed the instructions and everything seemed to go well, the only errors I had were the typical "connections refused"

    But I still have the same amount of HDD space as before 3.4G?????????????

    I tried doing it again but it kept telling me the file is already there and other errors.

    any other way to confirm this actually worked?


    error I get when do the t 2 83 w

    error re-reading the partition table failed with error 16:device or resource busy.

    w write table to disk and exit
    x extra functionality (experts only)

    Command (m for help): t
    Partition number (1-4): 82
    Value out of range.
    Partition number (1-4): 2
    Hex code (type L to list codes): l

    0 Empty 1e Hidden W95 FAT1 80 Old Minix be Solaris boot
    1 FAT12 24 NEC DOS 81 Minix / old Lin bf Solaris
    2 XENIX root 39 Plan 9 82 Linux swap / So c1 DRDOS/sec (FAT-
    3 XENIX usr 3c PartitionMagic 83 Linux c4 DRDOS/sec (FAT-
    4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
    5 Extended 41 PPC PReP Boot 85 Linux extended c7 Syrinx
    6 FAT16 42 SFS 86 NTFS volume set da Non-FS data
    7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set db CP/M / CTOS / .
    8 AIX 4e QNX4.x 2nd part 88 Linux plaintext de Dell Utility
    9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM df BootIt
    a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e1 DOS access
    b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e3 DOS R/O
    c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS e4 SpeedStor
    e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs
    f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ee EFI GPT
    10 OPUS 55 EZ-Drive a6 OpenBSD ef EFI (FAT-12/16/
    11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f0 Linux/PA-RISC b
    12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f1 SpeedStor
    14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f4 SpeedStor
    16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot f2 DOS secondary
    17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fd Linux raid auto
    18 AST SmartSleep 65 Novell Netware b8 BSDI swap fe LANstep
    1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid ff BBT
    1c Hidden W95 FAT3 75 PC/IX
    Hex code (type L to list codes):

    did I screw something up? My swap partition seems to be 82....
    speekergeek, Aug 3, 2008
  6. sailor070


    Jul 17, 2008
    Likes Received:
    very useful, thanks
    gerarddelafas, Aug 13, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.