Results 1 to 2 of 2

Thread: What if my SWAP partition dies?

  1. #1
    Join Date
    Feb 2010
    Location
    Salem, OR
    Beans
    50
    Distro
    Ubuntu 10.10 Maverick Meerkat

    What if my SWAP partition dies?

    Ok, I have a RAID1 for my main data, and a separate drive for my /tmp folder and another separate drive for my SWAP.

    I really haven't seen Linux actually use the SWAP because I have 8 gig of RAM.

    I know if for any reason if the drive that maps to /tmp fails to mount, the system uses the main /tmp folder without issue.

    But what would happen if for some reason my SWAP drive stopped working? Does the system stop working until that drive is fixed? Does it boot up and simply disable SWAP until it is fixed?

    I would really like to know before something actually happens to the swap. Mainly so I am prepared if it does.
    Glenn J. Schworak - Running nothing but Ubuntu on my servers and laptops!
    Schworak.com | BestLittleHairHouse.info | ArtFromTheTribe.com | EANData.com

  2. #2
    Join Date
    Mar 2009
    Beans
    1,322

    Re: What if my SWAP partition dies?

    It's the same as any other data failure on a disk. Only I don't think you could have a surface failure on your SWAP partition(s) and actually lose permanent data on the disk. You might have a program crash but I don't think you could lose "persisted" data.

    If you REALLY want a failure-tolerant drive, then you should put SWAP on RAID too. That's typical for a production server with real data on it.

    On my home box I've been playing with RAID for a few years, but haven't ever bothered to put SWAP on RAID. I have 12g RAM, and I know for a fact that it's never actually paged out to SWAP. I've put a lot of stuff on tmpfs too.

    If this is a normal workstation then the rest of the drive is going to see a lot more use than your SWAP partition. You need to have a partition of at least the size of your RAM, because if you hibernate it you need to page all your RAM out to disk, and AFAIK it needs to be a single partition. It would be entirely different if you had 1g RAM. Then your swap would be busy constantly, your box would run like carp and before you knew it the iron filings on your disk surface would get tuckered out and go to sleep forever.

    IMO the only way you'll get a swap failure statistically speaking is if your whole drive goes.
    Help stamp out MBR partition tables. Use GPT instead!

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
  •