4

Please give me advice on how to solve the error below.

Linux details:

Kernel version: 2.6.18

Linux-OS-5.3

Thanks

 # fdisk -l | grep /c0d0p6 /dev/cciss/c0d0p6 31790 33845 8385898+ 82 Linux swap / Solaris # mkswap /dev/cciss/c0d0p6 Setting up swapspace version 1, size = 8587153 kB # echo '/dev/cciss/c0d0p6 none swap sw 0 0' >> /etc/fstab # swapon -a swapon: cannot find the device for LABEL=SW-cciss/c0d0p6 

3 Answers 3

1

Try

mkswap -L SW-cciss/c0d0p6 /dev/cciss/c0d0p6 

Edit: could you try changing the fstab entry you describe above to read

/dev/cciss/c0d0p6 swap swap defaults 0 0 
3
  • hi I get mkswap -L SW-cciss/c0d0p6 /dev/cciss/c0d0p6 Setting up swapspace version 1, size = 8587153 kB LABEL=SW-cciss/c0d0p6, no uuid , and after swapon -s I dont get anything -:( Commented Mar 11, 2011 at 12:10
  • how to make fallback to swap procedure? Commented Mar 11, 2011 at 14:09
  • Could we see the whole of your /etc/fstab? Commented Mar 11, 2011 at 19:10
11

sudo swapon -a

I got this;

 swapon: cannot find the device for UUID=03599533-3a7e-453c-99d2-dd9470e336fe 

then I tried

sudo swapon /dev/sda12

that being the address of my swap partition on my device although not absolute. It worked like a charm. I hope that works for you too.

1
  • 1
    To locate the swap partition: sudo fdisk -l Commented Apr 18, 2019 at 5:17
2

Use the command

$ blkid 

It will show you the list of all partition and their respective UUID

Copy the UUID of the swap partition

Use the command

$ sudo nano /etc/fstab 

Enter your root password. Then, in that file replace the existing UUID with the copied UUID from blkid

hit ctrl+o , hit enter, then hit ctrl+x

restart your computer

1
  • Thank you, this is THE solution to fix the broken UUID reference to the swap volume. Commented Aug 26, 2023 at 12:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.