Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new about swap and filesystem. Now I encounter a problem:

2G ext4 disk /dev/sda7 # Want to be used as swap in fedora

24G ext4 disk /dev/sda8 # My fedora is built on it without Swap

As described above, I want to use /dev/sda7 as swap in /dev/sda8. How to deal with it? Thank you!~

share|improve this question
up vote 4 down vote accepted

First - make sure there is nothing in /dev/sda7 you want to keep - this will wipe all data in it. /dev/sda7 should not be mounted.

Then run (as root):

# mkswap /dev/sda7
# swapon /dev/sda7

Then edit /etc/fstab and add a line:

/dev/sda7   none    swap    sw    0     0
share|improve this answer

It's better to use the UUID in the fstab file.

Type in a terminal:


and find the UUID-String. Copy this in the fstab, like so:

UUID=bdc82ac5-5605-44d1-b3d0-6b69a47accd7 swap         swap    defaults        0 0
share|improve this answer
I'm interested to know if this is the case for swap partitions. I use UUIDs for everything but I'm not sure it's important for the swap partition. Can anyone enlighten me? – boehj May 3 '11 at 12:06
@boehj The naming of devices (such as /dev/hda5) can change, for example, mobile devices or hard drive cables are reconnected in the computer. To get around this, can the UUID or the label of the device (the hard drive name, eg data) can be specified. Hope you undertand my bad english. – Pit Schnass May 4 '11 at 6:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .