when I do the:
mkswap /dev/sda3
mkswap: error: /dev/sda3 is mounted; will not make swapspace.
how to perfrom mkswap anyway , David
when I do the:
mkswap /dev/sda3
mkswap: error: /dev/sda3 is mounted; will not make swapspace.
how to perfrom mkswap anyway , David
"Swap off - swap on, Daniel-San", said Miyagi in Karate Kid.
Err.
What are you trying to do? Recreate swap space for an existing swap partition? Add more swap space by nuking an existing other partition? Please be way more specific. If you are for some reason recreating an already existing swap partition, use
With
mkswap -f /dev/sda3
you can probably proceed, but please read carefully what the man page tells you about it:In other words: if that partition contains something important, it WILL get nuked. I hope your next question isn't about restoring backups.
Are you sure you want to create swap on
/dev/sda3
? That message would imply that/dev/sda3
is already being used for a real filesystem and may contain data.First, check whether
/dev/sda3
is in use as a mounted filesystem by issuing themount
command. If/dev/sda3
is listed as a mounted filesystem stop, you pretty certainly don't want to do what you are trying to do.If it is listed, and you still wish to proceed and erase all the data on the partition then you must first
umount /dev/sda3
before youmkswap /dev/sda3
.If it is not listed then it is already swap, and is already in use. If you need to rebuild it (unlikely) then you must
swapoff /dev/sda3
before youmkswap /dev/sda3
.Once you have a successful
mkswap /dev/sda3
, you must finally doswapon /dev/sda3
.Remember to also edit your
/etc/fstab
to reflect the change of use of/dev/sda3
.