Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Swap does not mount [swapon failed: Device or resource busy]

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
wolverine_tech
Posts: 4
Joined: 2011-08-29 00:25

Swap does not mount [swapon failed: Device or resource busy]

#1 Post by wolverine_tech »

Hi,

The swap partition did not mount post-installation (Debian "Squeeze" (Xfce)).
Created a 2nd swap partition, & planned to delete the earlier swap partition. The 2nd swap partition doesn't mount either.

(Been using Debian (my 1st intro to Linux) for < 3 weeks. If
a) I'm missing any blindingly obvious solution(s)
b) this post should have been posted under a different topic/forum

then please let me know.)

Further info:
Followed the instructions at http://web.mit.edu/rhel-doc/5/RHEL-5-ma ... dding.html

/etc/fstab: (commented out the earlier swap partition)
---------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/mapper/HU-root / ext3 errors=remount-ro 0 1
# /boot was on /dev/sda5 during installation
UUID=50ed87f2-905e-4780-b867-a8e0831e3db8 /boot ext3 defaults 0 2
/dev/mapper/HU-home /home ext3 defaults,user_xattr 0 2

/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/sdb1 /media/usb0 auto rw,user,noauto 0 0

#/dev/mapper/HU-swap none swap sw 0 0
#2nd_swap
/dev/mapper/HU-swap2 swap swap defaults 0 0
------------------------------------------------------------------------------------------------------------------------------

(tried /dev/HU/swap2 instead of /dev/mapper/HU-swap2. Did not work.)

Output of fdisk -l

Code: Select all

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xed1f86f7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2   *          64          77      102400    7  HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3              77        3481    27343750    7  HPFS/NTFS
Partition 3 does not end on cylinder boundary.
/dev/sda4            3481       14594    89261057    5  Extended
Partition 4 does not end on cylinder boundary.
/dev/sda5            3481        3572      732160   83  Linux
/dev/sda6            3573       14594    88527872   8e  Linux LVM
Output of swapon -a

Code: Select all

swapon: /dev/mapper/HU-swap2: swapon failed: Device or resource busy
Output of swapon -va

Code: Select all

swapon on /dev/mapper/HU-swap2
swapon: /dev/mapper/HU-swap2: found swap signature: version 1, page-size 4, same byte order
swapon: /dev/mapper/HU-swap2: pagesize=4096, swapsize=2147483648, devsize=2147483648
swapon: /dev/mapper/HU-swap2: swapon failed: Device or resource busy
Output of swapon -s

Code: Select all

swapon on /dev/mapper/HU-swap2
Filename				Type		Size	Used	Priority
/dev/dm-3                               partition	2097144	0	42
How can I mount swap upon booting? Would really appreciate help/suggestions.
Thanks for your time and patience,
--

bcl
Posts: 2
Joined: 2013-06-11 14:10

Re: Swap does not mount [swapon failed: Device or resource b

#2 Post by bcl »

Hi !

I think I've had a similar problem. I solved it by changing the /etc/grub.d/10_linux file as indicated in the FAQ of http://wiki.debian.org/Grub

I hope it will work for you.

AnInkedSoul
Posts: 461
Joined: 2010-06-11 05:05

Re: Swap does not mount [swapon failed: Device or resource b

#3 Post by AnInkedSoul »

holy dead thread resurrection batman

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Swap does not mount [swapon failed: Device or resource b

#4 Post by vbrummond »

AnInkedSoul wrote:holy dead thread resurrection batman
:D
Always on Debian Testing

AnInkedSoul
Posts: 461
Joined: 2010-06-11 05:05

Re: Swap does not mount [swapon failed: Device or resource b

#5 Post by AnInkedSoul »

hope the dude returns to mark his thread as solved!

bcl
Posts: 2
Joined: 2013-06-11 14:10

Re: Swap does not mount [swapon failed: Device or resource b

#6 Post by bcl »

The thing is that I found this page ooking for solutions for myself, so when I found a solution, I told him.

Randicus
Posts: 2663
Joined: 2011-05-08 09:11

Re: Swap does not mount [swapon failed: Device or resource b

#7 Post by Randicus »

bcl wrote:The thing is that I found this page ooking for solutions for myself, so when I found a solution, I told him.
The person made four posts in one month two years ago. What are the chances that person ever looks at this board, let alone is keeping track of the thread? Especially considering there were no replies two years ago. It is nice to be helpful, but ...

AnInkedSoul
Posts: 461
Joined: 2010-06-11 05:05

Re: Swap does not mount [swapon failed: Device or resource b

#8 Post by AnInkedSoul »

bcl wrote:The thing is that I found this page ooking for solutions for myself, so when I found a solution, I told him.
coolbeans - do whatever floats your boat

User avatar
saulgoode
Posts: 1445
Joined: 2007-10-22 11:34
Been thanked: 4 times

Re: Swap does not mount [swapon failed: Device or resource b

#9 Post by saulgoode »

Randicus wrote:The person made four posts in one month two years ago. What are the chances that person ever looks at this board, let alone is keeping track of the thread? Especially considering there were no replies two years ago. It is nice to be helpful, but ...
And now when someone performs a web search on "swapon failed" and are led to this forum, they will find a potential solution to the problem. In my opinion, that is a good thing (as a general rule, I blacklist sites that are filled with lots of questions/bug reports, but offer no solutions).
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian Kernighan

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: Swap does not mount [swapon failed: Device or resource b

#10 Post by llivv »

bcl wrote: I think I've had a similar problem. I solved it by changing the /etc/grub.d/10_linux file as indicated in the FAQ of http://wiki.debian.org/Grub
All the way at the bottom of the page :lol:
edit: grub2 is depreciated since 2009 iirc
so it is up to anyone wanting to use this solution to figure out what version of grub
they are currently using and make appropriate adjustments to the commands.
Grub-FAQ wrote:Finally run update-grub2

By default grub2 in debian will not add 'resume=/dev/swap-partition' option.
But if you want to perform this by default you can edit /etc/grub.d/10_linux file and make some changes there:

Replace

linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}

with this

linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} resume=`swapon -s | grep '/dev/sd.[0-9]' -o`

This will add your first swap partition to all found linux entries.
batman wrote: Aye Robin,
and the wiki link is "mostly" outdated too. ...
Back to the bat cave for us both.. grrrr
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

Randicus
Posts: 2663
Joined: 2011-05-08 09:11

Re: Swap does not mount [swapon failed: Device or resource b

#11 Post by Randicus »

saulgoode wrote:And now when someone performs a web search on "swapon failed" and are led to this forum, they will find a potential solution to the problem. In my opinion, that is a good thing (as a general rule, I blacklist sites that are filled with lots of questions/bug reports, but offer no solutions).
I can accept that logic if a thread is not too old, but in this case, the solution was directed at the OP.
bcl wrote:I hope it will work for you.
bcl wrote:The thing is that I found this page ooking for solutions for myself, so when I found a solution, I told him.
A post along the lines of, "If anyone else runs into this problem, I found a solution ...," would be fine, but in my opinion, posting for the benefit of a person who asked a question years ago is silly.

Post Reply