Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here is what I'm trying to do. I have a /home (sda1) and swap (sda2) partition on one disk that I want to merge into a larger swap partition and utilize all of the swap space. When I used the fdisk utility and created my partition (sdb1) I had it use all of the sector space. I then used the mkswap and I think I might have made a mistake doing that at this point because I can't mount sdb1 to anything now without getting the "mount: unknown filesystem type 'swap'" error. This prevents me from using cp. I'm running Fedora 3.10.5 and am working entirely in a terminal window.

Any advice is appreciated. Or let me know how I can phrase the question better if it is poor.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Warning: I hope that you know what you are doing, because in most cases, reformatting /dev/sda1 on a running system seems like asking for a big trouble!

One does not mount swap partitions.

After you formatted partition as swap using mkswap /dev/sda1, there are 2 ways to make use of new swap partition:

  • Manual: use swapon utility, something like swapon /dev/sda1. It would enable swap partition, but it would not survive reboot.
  • Automatic: add lines like this into your /etc/fstab:

    /dev/sda1 none swap sw 0 0
    

Then, at boot, it would automatically execute swapon -a and enable all swap partitions listed in /etc/fstab.

In both cases, utility free will list swaps in use, so you can confirm that it really worked.

Alternatively, you don't really have to format partition as swap (and destroy all existing data). You can simply create big non-sparse file on existing partition and mount it as additional swap source. You can read more about this here.

share|improve this answer
    
Thank you! This helped tremendously! –  TZPike05 Oct 1 '13 at 2:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.