LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-03-2006, 05:36 AM   #1
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Rep: Reputation: 0
Umounting /dev/md0 still in use


I am using Debian etch. I have raid1 on /. While running mdadm-raid, I see failed(busy). While running umounting fs, I see /dev/md0 still in use. How can I fix this problem and umount it correctly while running shutdown or reboot? Here is my rc6.d:


Code:
mail:~# ls /etc/rc6.d
K11atd               K20inetd      K21mysql-ndb     README
K11cron              K20lpd        K21spamassassin  S20sendsigs
K19mysql-ndb-mgm     K20makedev    K25hwclock.sh    S30urandom
K20acpid             K20mysql      K25mdadm         S31umountnfs.sh
K20apcupsd           K20pop3d      K75hdparm        S32portmap
K20authdaemond       K20pop3d-ssl  K79nfs-common    S35networking
K20clamav-daemon     K20postfix    K79quotarpc      S36ifupdown
K20clamav-freshclam  K20saslauthd  K85quota         S40umountfs
K20dcc-client        K20ssh        K89klogd         S50mdadm-raid
K20imapd             K20xinetd     K90sysklogd      S60umountroot
K20imapd-ssl         K21amavisd    K91apache2       S90reboot
 
Old 08-03-2006, 06:05 AM   #2
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
you can check the processes that are still using /dev/md0 by running
Code:
fuser -m /mountpoint
where mountpoint is where /dev/md0 is mounted.
you can kill the processes by adding -k as a parameter.
 
Old 08-03-2006, 06:09 AM   #3
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you very much. I'll try it.
 
Old 08-03-2006, 06:57 AM   #4
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Will it unload modules? fuser -m -v / shows applications and modules. Unload modules is unwanted.
 
Old 08-03-2006, 07:30 AM   #5
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Does exist better solution than fuser -mk /? fuser-mk / will stop all processes even mdadm process.
 
Old 08-03-2006, 08:17 AM   #6
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
try to compare the PIDs with the output of 'ps -A'. i don't think you'll need to kill all the processes. btw why are you trying to unmount / ?. are you shutting the system down?

Last edited by konsolebox; 08-03-2006 at 05:51 PM.
 
Old 08-03-2006, 10:48 AM   #7
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Yes, I'm shutting the system down. I want umount it correctly. Can this incorrect umounting break the file system?
 
Old 08-03-2006, 11:53 AM   #8
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Here is ps -A before umountfs process:

PID TTY TIME CMD
1 ? 00:00:00 init
2 ? 00:00:00 ksoftirqd/0
3 ? 00:00:00 watchdog/0
4 ? 00:00:00 events/0
5 ? 00:00:00 khelper
6 ? 00:00:00 kthread
8 ? 00:00:00 kblockd/0
9 ? 00:00:00 kacpid
141 ? 00:00:00 pdflush
142 ? 00:00:00 pdflush
144 ? 00:00:00 aio/0
143 ? 00:00:00 kswapd0
743 ? 00:00:00 kseriod
1058 ? 00:00:00 khubd
1947 ? 00:00:00 ata/0
3008 ? 00:00:00 scsi_eh_0
3009 ? 00:00:00 scsi_eh_1
3010 ? 00:00:00 scsi_eh_2
3011 ? 00:00:00 scsi_eh_3
3292 ? 00:00:00 md0_raid1
3365 ? 00:00:00 xfslogd/0
3367 ? 00:00:00 xfsdatad/0
3369 ? 00:00:00 xfsbufd
3370 ? 00:00:00 xfssyncd
3826 ? 00:00:00 kpsmoused
5442 ? 00:00:00 xfsbufd
5443 ? 00:00:00 xfssyncd
10819 ? 00:00:00 rc
11210 ? 00:00:00 S40umountfs
11211 ? 00:00:00 ps

What to kill?
 
Old 08-03-2006, 05:59 PM   #9
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by vasek125125
Yes, I'm shutting the system down. I want umount it correctly. Can this incorrect umounting break the file system?
No unless you turnoff your system when the hard disk is still in rw mode. To remount your hd in ro mode:
Code:
sync; mount -o remount,ro /
. BTW where's the output of 'fuser -m'? After remounting in ro mode, you can try to kill any process you like.
 
Old 08-04-2006, 05:41 AM   #10
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
S60umountroot process makes remounting fs on / to read-only mode. RO incorrect umounting will not break fs?

Last edited by vasek125125; 08-04-2006 at 06:19 AM.
 
Old 08-04-2006, 06:24 AM   #11
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Here is fuser -muv / before reboot

Code:
                     USER        PID ACCESS COMMAND
                     root          1 .rce. (root)init
                     root          2 .rc.. (root)ksoftirqd/0
                     root          3 .rc.. (root)watchdog/0
                     root          4 .rc.. (root)events/0
                     root          5 .rc.. (root)khelper
                     root          6 .rc.. (root)kthread
                     root          8 .rc.. (root)kblockd/0
                     root          9 .rc.. (root)kacpid
                     root        141 .rc.. (root)pdflush
                     root        142 .rc.. (root)pdflush
                     root        144 .rc.. (root)aio/0
                     root        143 .rc.. (root)kswapd0
                     root        743 .rc.. (root)kseriod
                     root       1184 .rc.. (root)khubd
                     root       2093 .rc.. (root)ata/0
                     root       3008 .rc.. (root)scsi_eh_0
                     root       3009 .rc.. (root)scsi_eh_1
                     root       3010 .rc.. (root)scsi_eh_2
                     root       3011 .rc.. (root)scsi_eh_3
                     root       3292 .rc.. (root)md0_raid1
                     root       3365 .rc.. (root)xfslogd/0
                     root       3367 .rc.. (root)xfsdatad/0
                     root       3369 .rc.. (root)xfsbufd
                     root       3370 .rc.. (root)xfssyncd
                     root       4739 .rc.. (root)kpsmoused
                     root       7747 frce. (root)rc
                     root       8164 frce. (root)S90reboot
                     root       8166 .rc.. (root)xfsbufd
                     root       8167 .rc.. (root)xfssyncd
I don't know what to kill.
 
Old 08-04-2006, 07:00 AM   #12
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,245
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
when you remount a filesystem in RO mode, the kernel automatically flushes the buffers to the drive. so when the drive is in read-only mode, no harm can be done to the filesystem. it means no more writing so no harm.

there's no doubt that almost all process uses /. i don't know which process to kill too. can't you just remount your fs in ro mode then try to kill the processes you can?

sometimes shutdown scripts goes to this procedure:

first send all processess the terminate signal (kill -15).
then send them the kill signal (kill -9).
the kernel processes remains and it's now safe for system shutdown.
 
Old 08-04-2006, 08:21 AM   #13
vasek125125
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
These commands are unknown - kill -15 and kill -9. Kill gives me help how to use it. But I think, there is no problem, because there is sending all processes the term signal and then kill signal when rebooting.
 
  


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
RAID5 using mdadm, how to mount /dev/md0? ggduff Linux - Software 4 11-14-2007 01:59 AM
unable to auto mount /dev/md0 RAID 1 TheMatrix64 Linux - Newbie 4 04-09-2007 07:49 PM
mdadm: no devices found for /dev/md0 humbletech99 Linux - General 2 06-19-2006 04:28 AM
Crash while resyncing /dev/md0 HelaWann Linux - Enterprise 1 12-06-2005 08:52 AM
can not mount RAID 0 /dev/md0 dysenteryduke Linux - Software 3 09-15-2005 03:19 PM


All times are GMT -5. The time now is 03:43 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