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

Kernels & Hardware, configuring network, installing services

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

Postby wolverine_tech » 2011-09-14 15:20

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,
--
wolverine_tech
 
Posts: 4
Joined: 2011-08-29 00:25

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

Postby bcl » 2013-06-11 14:45

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.
bcl
 
Posts: 2
Joined: 2013-06-11 14:10

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

Postby AnInkedSoul » 2013-06-11 14:46

holy dead thread resurrection batman
AnInkedSoul
 
Posts: 461
Joined: 2010-06-11 05:05

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

Postby vbrummond » 2013-06-11 15:04

AnInkedSoul wrote:holy dead thread resurrection batman

:D
vbrummond
 
Posts: 4344
Joined: 2010-03-02 01:42

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

Postby AnInkedSoul » 2013-06-11 15:06

hope the dude returns to mark his thread as solved!
AnInkedSoul
 
Posts: 461
Joined: 2010-06-11 05:05

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

Postby bcl » 2013-06-12 06:42

The thing is that I found this page ooking for solutions for myself, so when I found a solution, I told him.
bcl
 
Posts: 2
Joined: 2013-06-11 14:10

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

Postby Randicus » 2013-06-12 07:26

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 ...
Linux refugee having fled the merciless onslaught of systemd and the Buntard horde to a haven of sanity.
Randicus
 
Posts: 2314
Joined: 2011-05-08 09:11

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

Postby AnInkedSoul » 2013-06-12 09:58

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
AnInkedSoul
 
Posts: 461
Joined: 2010-06-11 05:05

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

Postby saulgoode » 2013-06-12 10:20

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
saulgoode
 
Posts: 1520
Joined: 2007-10-22 11:34

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

Postby llivv » 2013-06-12 18:10

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 the kitchen with Julia ....
[...]
Get on the D bus to B Can ....
[...]
User avatar
llivv
 
Posts: 5582
Joined: 2007-02-14 18:10
Location: willo the tree

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

Postby Randicus » 2013-06-12 22:18

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.
Linux refugee having fled the merciless onslaught of systemd and the Buntard horde to a haven of sanity.
Randicus
 
Posts: 2314
Joined: 2011-05-08 09:11


Return to System configuration

Who is online

Users browsing this forum: debianxfce, stevepusser and 9 guests

fashionable