LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 03-03-2010, 03:35 PM   #1
shaggyrol
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
Can't open /dev/sdc1 exclusively. Mounted filesystem?


Hello Everyone

Im working on a RHEL 5.4 x64 system.

I have 2 internal drives on a RAID configuration to support my / partition and swap.

On the other hand i have and old storage IBM EXP400 on a raid 5 with 1449 GB holding my /home in a VG.

Due to my /home partition was almost reaching full capacity i decided to add an extra storage, this time with a newer storage model , IBM DS4700 with a raid 5 with 2047 GB.

The DS4700 is a FC dual controller, so i had to add a dual FC hba emulex to the system as well as the RDAC driver to make multipath available.

At the time i try to configure my newly device (/dev/sdc) im not able to mount it or format it , either as a lvm or as a common ext2 or 3 type

Commands output:

df -h

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 26G 19G 5.3G 78% /
/dev/mapper/VolGroup00-LogVol00
1.4T 1.2T 124G 91% /home
tmpfs 2.0G 0 2.0G 0% /dev/shm

------------------------------------------------------------------------

fdisk -l

Disk /dev/sda: 36.4 GB, 36401315840 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3393 27254241 83 Linux
/dev/sda2 3394 4425 8289540 82 Linux swap / Solaris

Disk /dev/sdb: 1499.9 GB, 1499998453760 bytes
255 heads, 63 sectors/track, 182364 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 182364 1464838798+ 8e Linux LVM

Disk /dev/sdc: 2047.8 GB, 2047868928000 bytes
255 heads, 63 sectors/track, 248972 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 248972 1999867558+ 83 Linux

Disk /dev/dm-0: 2047.8 GB, 2047868928000 bytes
255 heads, 63 sectors/track, 248972 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/dm-0p1 1 248972 1999867558+ 83 Linux

-------------------------------------------------------------------------

file -s

/dev/sda: x86 boot sector; partition 1: ID=0x83, active, starthead 1, startsector 63, 54508482 sectors; partition 2: ID=0x82, starthead 254, startsector 54508545, 16579080 sectors, code offset 0x48
/dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
/dev/sda2: Linux/i386 swap file (new style) 1 (4K pages) size 2072384 pages Label SWAP-sda2
/dev/sdb: x86 boot sector; partition 1: ID=0x8e, active, starthead 1, startsector 63, 2929677597 sectors
/dev/sdb1: LVM2 (Linux Logical Volume Manager) , UUID: DAwwpeS9MAdTDVBfVWNmDTaMiXCs7pm
/dev/sdc: x86 boot sector; partition 1: ID=0x83, starthead 1, startsector 63, 3999735117 sectors, extended partition table (last)\011
/dev/sdc1: x86 boot sector; partition 1: ID=0x83, starthead 2, startsector 63, 3999735054 sectors, extended partition table (last)\011

----------------------------------------------------------------------------------------------------------------------------
mkfs.ext3 /dev/sdc1

mke2fs 1.39 (29-May-2006)
/dev/sdc1 is apparently in use by the system; will not make a filesystem here!

----------------------------------------------------------------------------------------------------------------------------

mount |grep sd

/dev/sda1 on / type ext3 (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)

(sdc is not mounted at all)

----------------------------------------------------------------------------------------------------------------------------
cat /proc/partitions

major minor #blocks name

8 0 35548160 sda
8 1 27254241 sda1
8 2 8289540 sda2
8 16 1464842240 sdb
8 17 1464838798 sdb1
8 32 1999872000 sdc
8 33 1999867558 sdc1
253 0 1999872000 dm-0
253 1 1464827904 dm-1


Any thoughts on why the system keeps saying the partition is in use? i have tried fuser -ck /dev/sdc1 and still im unable to mount it, also i partioned once sdc as a lvm and tried to create a pv with sdc and has a similar message to format one: Can't open /dev/sdc1 exclusively. Mounted filesystem?
 
Old 03-03-2010, 04:04 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Doesn't the device have firmware controlling disk access ? And software to manage the disks ?
 
Old 03-03-2010, 05:30 PM   #3
shaggyrol
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
The Storage controller does have firmware and software to manage the disks, This is the way the array and mapping was done to the server, the problem seems to be now at the OS level which sees the new device as it is used when it is a 100% new device
 
Old 03-03-2010, 06:08 PM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Quote:
/dev/sdc: x86 boot sector; partition 1: ID=0x83, starthead 1, startsector 63, 3999735117 sectors, extended partition table (last)\011
/dev/sdc1: x86 boot sector; partition 1: ID=0x83, starthead 2, startsector 63, 3999735054 sectors, extended partition table (last)\011
Should sdc1 be listed as a boot sector ? Neither sda or sdb listing look like that

Quote:
/dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
/dev/sda2: Linux/i386 swap file (new style) 1 (4K pages) size 2072384 pages Label SWAP-sda2
 
Old 03-04-2010, 11:37 AM   #5
shaggyrol
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
I agree that sda and sdb dpesmt looks like sdc1, the problem is that i didnt set those values, so How can i possibly change them? im stuck since i dont know if this is a problem with my storage or with my fc card config, or The OS, i have done this before with qlogic adapters, and devices works just fine, by reading the RDAC driver documentation it says Emulex hbas should work as well so, no way to go by now, i could say i ve tried almost anything and im just able to see my device is present but not configurable at all
 
Old 04-27-2010, 06:40 AM   #6
D3x
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 1
Lightbulb mpath stealing already multipathed RDAC device

Quote:
Originally Posted by shaggyrol View Post
Any thoughts on why the system keeps saying the partition is in use? i have tried fuser -ck /dev/sdc1 and still im unable to mount it, also i partioned once sdc as a lvm and tried to create a pv with sdc and has a similar message to format one: Can't open /dev/sdc1 exclusively. Mounted filesystem?
Hi, seems you got the same problem I am solving right now ...

The problem here is (I think) that OS Multipath is "stealing" the (already multipathed device created by RDAC) and trying to make another failover layer/device ...

If you take a look at /dev/mpath/* and you see some device[s] that means that this is the case, right now Im in the proces of analyzing why the heck it is doint it.

Simple solution is disabling the devices created by OS multipath, the the MPP device is free again and you can work with it normaly ...

# pvcreate /dev/sdb
Can't open /dev/sdb exclusively. Mounted filesystem?

# cat /proc/partitions
major minor #blocks name

8 0 143247360 sda
8 1 104391 sda1
8 2 143139150 sda2
8 16 292444160 sdb
253 0 20840448 dm-0
253 1 5111808 dm-1
253 2 5111808 dm-2
253 3 5111808 dm-3
253 4 4096000 dm-4
253 5 292444160 dm-5


#ls /dev/mpath/*
/dev/mpath/3600a0bxxxxxxxxxxxxxxx6fb50

# dmsetup status
RootVG-swap: 0 8192000 linear
RootVG-root: 0 10223616 linear
RootVG-root: 10223616 31457280 linear
mpath8: 0 584888320 multipath 2 0 0 0 1 1 A 0 1 0 8:16 A 0
RootVG-tmp: 0 10223616 linear
RootVG-usr: 0 10223616 linear
RootVG-var: 0 10223616 linear


# dmsetup ls
RootVG-swap (253, 4)
RootVG-root (253, 0)
mpath8 (253, 5)
RootVG-tmp (253, 3)
RootVG-usr (253, 2)
RootVG-var (253, 1)


# dmsetup remove mpath8
# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created

... voila

but how to make this persistent Im not sure yet .. will post after I get to it ...

Last edited by D3x; 04-27-2010 at 07:02 AM.
 
Old 04-27-2010, 09:11 AM   #7
D3x
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 1
Thumbs up Persistent solution

Well this was quite easy ... one has to blacklist the mpath in its configuration file (simple remove from init doesnt do the job since it is started by device-mapper anyway). So ...

/etc/multipathd.conf:

blacklist {
devnode "*"
}

Since MPIO and RDAC cant cooexist I blacklisted all devices ...

Then mppUpdate, Reboot .. and thats that
 
1 members found this post helpful.
Old 04-28-2010, 01:29 PM   #8
shaggyrol
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
You are right, this solve the whole thing, just changing that simple file, i tried lots of stuff and even think on change to qlogic, Thanks
 
Old 08-23-2012, 09:20 AM   #9
i_m_mahmoud
LQ Newbie
 
Registered: Apr 2011
Posts: 5

Rep: Reputation: 0
Smile Solved for me

I solved this problem in Centos by running

Quote:
/sbin/dmsetup remove_all
 
Old 11-14-2012, 05:06 PM   #10
microapp
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
i_m_mahmoud:
Solved for me
--------------------------------------------------------------------------------

I solved this problem in Centos by running

Quote:

/sbin/dmsetup remove_all
==============================
it is ok. thanks.
 
Old 11-25-2012, 01:43 AM   #11
ankur_verma
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
Lightbulb Solution of cannot open /dev/sdd1 exclusively. mounted filesystem

Hi friends

I got the same problem cannot open /dev/sdd1 exclusively. mounted filesystem ?

no need of take headk

just do the following steps

1:-find all the physical volumes

pvs -o +uuid

2:-
pvremove -ffy /dev/sdd
 
Old 05-31-2013, 10:34 AM   #12
Petrus45
LQ Newbie
 
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
Hi I was reading this and found a solution elsewhere that I think may help. I need to make this post in order for the forum to allow me to post a URL.

---------- Post added 05-31-13 at 10:34 AM ----------

here is another possibility if you are using multipath: blacklisting the drive in multipath.conf

http://www.centos.org/docs/5/html/5....procedure.html
 
Old 07-18-2013, 08:24 AM   #13
zioalex
LQ Newbie
 
Registered: Jul 2013
Posts: 1

Rep: Reputation: Disabled
Thanks to All
Code:
dmsetup remove_all
solves all my problems.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware won't boot "/dev/sdc1 contains a filesystem with errors" vttay03 Slackware 4 01-15-2010 08:41 AM
Can not find sdc1 and /dev takes a very long time to load walterbyrd Debian 2 10-31-2009 12:29 PM
grub on /dev/sdc and live-usb on /dev/sdc1 fitzov Linux - General 2 04-25-2007 11:11 AM
'Error trying to open /dev/scd0 exclusively' in RH9 cdrecord - help? tmadhavan Linux - Software 21 05-10-2004 06:13 AM
cdrecord - Error trying to open /dev/scd0 exclusively... jeffreybluml Linux - Newbie 10 03-22-2004 06:43 PM


All times are GMT -5. The time now is 03:25 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration