Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] mkswap: cannot open /dev/sda3: Device busy
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
SirRobin2318
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 241
Location: Strasbourg, france.

PostPosted: Fri Jul 31, 2015 10:54 am    Post subject: [SOLVED] mkswap: cannot open /dev/sda3: Device busy Reply with quote

Hi all,

I've got a strange problem, I can't "mkswap -f /dev/sda3", it tells me sda3 is busy.
I don't understand why, it's not mounted.

Even if I boot a live distro from usb, it tells me the same thing, and it's not mounted either on the live distro.

mount | grep sda3 returns nothing, here is the full mount output:
Code:
/dev/sda4 on / type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cache)
devtmpfs on /dev type devtmpfs (rw,relatime,size=4022300k,nr_inodes=1005575,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
/dev/sda4 on /home type btrfs (rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cache)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=804952k,mode=700,uid=1000,gid=1000)
/dev/sda4 on /mnt/gentoo type btrfs (rw,relatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cache)


fdisk -l /dev/sda
Code:
Disk /dev/sda: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AC03ED57-317B-41A1-82DC-DA99F6FC56CF

Device        Start        End   Sectors   Size Type
/dev/sda1      2048     411647    409600   200M EFI System
/dev/sda2    411648    1435647   1024000   500M Linux filesystem
/dev/sda3   1435648   17707007  16271360   7.8G Linux swap
/dev/sda4  17707008 1000214527 982507520 468.5G Linux filesystem


So what am I missing?


Last edited by SirRobin2318 on Fri Jul 31, 2015 4:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 435
Location: Australia

PostPosted: Fri Jul 31, 2015 12:27 pm    Post subject: Reply with quote

It's mounted somewhere.
Code:
# swapon -s

Code:
man swapoff
Back to top
View user's profile Send private message
SirRobin2318
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 241
Location: Strasbourg, france.

PostPosted: Fri Jul 31, 2015 3:06 pm    Post subject: Reply with quote

It's not.

swapon -s, swapon --show both return nothing.
cat /proc/swap shows only column titles with no data:
Code:
Filename                                Type            Size    Used    Priority


However; journalctl -b 0 | ack sda3:
Code:
Jul 27 12:20:22 daban-urnud kernel:  sda: sda1 sda2 sda3 sda4
Jul 27 12:20:22 daban-urnud systemd[1]: Found device LVM PV DE2RA4-1Mx3-Lbf9-fyDa-KRUp-eW0D-UenNMX on /dev/sda3 3.
Jul 27 12:20:22 daban-urnud swapon[330]: swapon: /dev/sda3: read swap header failed
Jul 27 12:20:22 daban-urnud systemd[1]: dev-sda3.swap: Swap process exited, code=exited status=255
Jul 27 12:20:22 daban-urnud systemd[1]: dev-sda3.swap: Unit entered failed state.


I'm guessing it's the LVM thing, what can I do about that?
Back to top
View user's profile Send private message
SirRobin2318
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 241
Location: Strasbourg, france.

PostPosted: Fri Jul 31, 2015 3:59 pm    Post subject: Reply with quote

OK, lvremove did the trick.
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 435
Location: Australia

PostPosted: Fri Jul 31, 2015 3:59 pm    Post subject: Reply with quote

I'm no help on LVM, I'm not using it.
Having said that, I've never had a problem with swap. If I did, though:
I'd approach this booting sysrescuecd and using gparted to delete and recreate the swap partition, and try again to mkswap
Sorry, that's my only idea. It looks like the swap partition might be corrupted seeing as the header is unreadable.
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 435
Location: Australia

PostPosted: Fri Jul 31, 2015 4:01 pm    Post subject: Reply with quote

Great that you got it fixed. As a matter of interest, do you hibernate the system?
Back to top
View user's profile Send private message
SirRobin2318
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 241
Location: Strasbourg, france.

PostPosted: Fri Jul 31, 2015 4:02 pm    Post subject: Reply with quote

Quote:
I'd approach this booting sysrescuecd and using gparted to delete and recreate the swap partition, and try again to mkswap

I actually did that :)
But the problem was that lvm was mapping the device, both booting gentoo and my live cd, and since I don't use lvm either I was slow on that one. For reference lvremove is what you want.
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 435
Location: Australia

PostPosted: Fri Jul 31, 2015 4:10 pm    Post subject: Reply with quote

Quote:
I actually did that :)
But the problem was that lvm was mapping the device, both booting gentoo and my live cd, and since I don't use lvm either I was slow on that one.


Well, that was new. Was this on a new install though, or did something else make an existing swap unusable? (Sorry, mysteries bother me).
Back to top
View user's profile Send private message
SirRobin2318
Apprentice
Apprentice


Joined: 24 Apr 2004
Posts: 241
Location: Strasbourg, france.

PostPosted: Fri Jul 31, 2015 4:13 pm    Post subject: Reply with quote

Your intuition is correct, fedora was briefly installed on the machine, so it created that lvm stuff, I didn't realise it would be a problem.
Back to top
View user's profile Send private message
ian.au
Guru
Guru


Joined: 07 Apr 2011
Posts: 435
Location: Australia

PostPosted: Fri Jul 31, 2015 4:23 pm    Post subject: Reply with quote

Got it, thx/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum