Find the answer to your Linux question:
Results 1 to 10 of 10
I have Ubuntu 9.04 I t seems it doesn't umount the filesystems (ReiserFS) on shutdown or restart. There is no matter if I click on Gnome's shutdown/restart button, or I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    5

    [SOLVED] Ubuntu does not umount filesystems on shutdown or restart


    I have Ubuntu 9.04
    I t seems it doesn't umount the filesystems (ReiserFS) on shutdown or restart.
    There is no matter if I click on Gnome's shutdown/restart button, or I type "shutdown -r now" - after restart, I see the following message in console:
    "Filesystem is not clean" and the system forces ReiserFS's checking process every time.

    I tried to find the reason, but no success.
    I was not able to force shutdown process to log what it does; umount related services seem to be configured properly:

    Code:
    umountfs                  0:on   1:off  2:off  3:off  4:off  5:off  6:off
    umountnfs.sh              0:on   1:off  2:off  3:off  4:off  5:off  6:off
    umountroot                0:on   1:off  2:off  3:off  4:off  5:off  6:off
    Here is /etc/fstab:

    Code:
    proc /proc proc defaults 0 0
    # Entry for /dev/sda1 :
    UUID=32b994f9-7734-400a-9708-501705ef6fa5 / reiserfs notail,relatime 0 1
    # Entry for /dev/sda5 :
    UUID=a1acb64d-4cb2-4400-832a-79d73c613b18 /home reiserfs relatime 0 2
    # Entry for /dev/sda8 :
    UUID=c13a0612-3880-429b-8d5f-049ada9109dc /opt reiserfs relatime 0 2
    # Entry for /dev/sda10 :
    UUID=62617ffc-5a46-43a3-b90f-e1c3802e275a /other reiserfs relatime 0 2
    # Entry for /dev/sda7 :
    UUID=9bf840d0-d8ec-4aee-87ed-8ef82d20c571 /usr reiserfs relatime 0 2
    # Entry for /dev/sda6 :
    UUID=8c0887b4-470f-4dd6-9ff8-0e16ae3305c0 /var reiserfs relatime 0 2
    # Entry for /dev/sda9 :
    UUID=c3eb5791-fd6a-492d-94f3-ae0a2f9024d8 /work reiserfs relatime 0 2
    # Entry for /dev/sda2 :
    UUID=2962f33a-f3df-44c9-a2dd-1cb2216f117f none swap sw 0 0
    /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
    
    # /dev/sda4
    UUID=ECFC0A72FC0A36FC /windows ntfs-3g defaults,locale=en_US.UTF-8 0 0

  2. #2
    Just Joined!
    Join Date
    May 2009
    Posts
    15
    Hello,

    In your fstab you are telling the filesystem to run a check on boot up. If you do not want this, change it to 0.

    For example you have:

    Code:
    # Entry for /dev/sda8 :
    UUID=c13a0612-3880-429b-8d5f-049ada9109dc /opt reiserfs relatime 0 2
    change to
    Code:
    # Entry for /dev/sda8 :
    UUID=c13a0612-3880-429b-8d5f-049ada9109dc /opt reiserfs relatime 0 0

  3. #3
    Just Joined!
    Join Date
    Jun 2009
    Posts
    5
    Quote Originally Posted by gnuub View Post
    In your fstab you are telling the filesystem to run a check on boot up. If you do not want this, change it to 0.
    I want filesystems to be checked on boot up.

    The problem is the system does not umount filesystems on correct restart (or shutdown).

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru D-cat's Avatar
    Join Date
    Jan 2009
    Location
    Bounce between Dover, NH - Shapleigh, ME
    Posts
    1,638
    It may not be an error of umount; have you seen any messages immediately following the Reiser fsck that may indicate that the check could not fix all errors? You may need to run reiserfsck manually with specific options if it's confirmed the autofix (--fix-fixable) isn't sufficient. see man reiserfsck for detailed explanation of options.

    If it indeed is umount failing, it's likely because some file is still open or a service failed to shut down prior, leaving the disk in use and thus un-umountable. I'm not exactly sure how to trace that one down.

  6. #5
    Just Joined!
    Join Date
    May 2009
    Posts
    15
    Hey ctrl0l,

    I completely misread what you meant. I apologize. Can you post portions of dmesg or from /var/log/messages that cover what is happening on startup to those disk?

    I know this issue is over the unmount during shutdown but I wanted to know if there was more data on startup on why the filesystem was flagged as dirty.

    Thank you.

  7. #6
    Just Joined!
    Join Date
    May 2009
    Posts
    15
    Also, as a troubleshooting sanity check, have you

    1. Boot up, let it go through the check
    2. Then after boot and check, comment out one of the filesytems in fstab (if possible... I see you have /other there. Can this be used?)
    3. Restart your system.
    4. After you system is up, un comment and then use mount to see if you still get a dirty filesystem? If so, does it give anymore details as to why it may be coming up dirty?


    I am assuming that when the system is up you can umount and mount the filesystems fine...

  8. #7
    Just Joined!
    Join Date
    Jun 2009
    Posts
    5
    Quote Originally Posted by D-cat View Post
    It may not be an error of umount; have you seen any messages immediately following the Reiser fsck that may indicate that the check could not fix all errors? You may need to run reiserfsck manually with specific options if it's confirmed the autofix (--fix-fixable) isn't sufficient. see man reiserfsck for detailed explanation of options.
    There are no errors after ReiserFS check.
    I tried to umount and manually check /work and /other. They were unmounted successfully and Reiser's fsck did not found any errors. Here are stdout for /work
    Code:
    $ sudo umount /work
    $ sudo reiserfsck /dev/sda9
    
    Replaying journal..
    Reiserfs journal '/dev/sda9' in blocks [18..8211]: 0 transactions replayed
    Checking internal tree..finished                  
    Comparing bitmaps..finished
    Checking Semantic tree:
    finished                                                                       
    No corruptions found
    There are on the filesystem:
    	Leaves 22038
    	Internal nodes 147
    	Directories 18878
    	Other files 75381
    	Data block pointers 6813453 (0 of them are zero)
    	Safe links 0
    ###########
    reiserfsck finished at Wed Jun  3 19:21:48 2009
    Quote Originally Posted by D-cat View Post
    If it indeed is umount failing, it's likely because some file is still open or a service failed to shut down prior, leaving the disk in use and thus un-umountable. I'm not exactly sure how to trace that one down.
    I also have wondered how can I see what exactly the system does on shutdown and if it really executes these services below?

    1. umountfs
    2. umountnfs.sh
    3. umountroot

  9. #8
    Just Joined!
    Join Date
    Jun 2009
    Posts
    5
    Quote Originally Posted by gnuub View Post
    Hey ctrl0l,

    I completely misread what you meant. I apologize. Can you post portions of dmesg or from /var/log/messages that cover what is happening on startup to those disk?

    I know this issue is over the unmount during shutdown but I wanted to know if there was more data on startup on why the filesystem was flagged as dirty.

    Thank you.
    Well, there is nothing special in dmesg:

    Code:
     16.653426] Adding 1534196k swap on /dev/sda2.  Priority:-1 extents:1 across:1534196k
    [   22.074288] lp0: using parport0 (interrupt-driven).
    [   43.991780] ReiserFS: sda5: found reiserfs format "3.6" with standard journal
    [   43.991803] ReiserFS: sda5: using ordered data mode
    [   44.002393] ReiserFS: sda5: journal params: device sda5, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
    [   44.004091] ReiserFS: sda5: checking transaction log (sda5)
    [   44.057412] ReiserFS: sda5: Using r5 hash to sort names
    [   44.096657] ReiserFS: sda8: found reiserfs format "3.6" with standard journal
    [   44.096683] ReiserFS: sda8: using ordered data mode
    [   44.101786] ReiserFS: sda8: journal params: device sda8, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
    [   44.103461] ReiserFS: sda8: checking transaction log (sda8)
    [   44.136643] ReiserFS: sda8: Using r5 hash to sort names
    [   44.172988] ReiserFS: sda10: found reiserfs format "3.6" with standard journal
    [   44.173017] ReiserFS: sda10: using ordered data mode
    [   44.181224] ReiserFS: sda10: journal params: device sda10, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
    [   44.182875] ReiserFS: sda10: checking transaction log (sda10)
    [   44.220438] ReiserFS: sda10: Using r5 hash to sort names
    [   44.269960] ReiserFS: sda7: found reiserfs format "3.6" with standard journal
    [   44.269989] ReiserFS: sda7: using ordered data mode
    [   44.277323] ReiserFS: sda7: journal params: device sda7, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
    [   44.278962] ReiserFS: sda7: checking transaction log (sda7)
    [   44.322506] ReiserFS: sda7: Using r5 hash to sort names
    [   44.362347] ReiserFS: sda6: found reiserfs format "3.6" with standard journal
    [   44.362377] ReiserFS: sda6: using ordered data mode
    [   44.367524] ReiserFS: sda6: journal params: device sda6, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
    [   44.369203] ReiserFS: sda6: checking transaction log (sda6)
    [   44.395302] ReiserFS: sda6: Using r5 hash to sort names
    [   44.434431] ReiserFS: sda9: found reiserfs format "3.6" with standard journal
    [   44.434463] ReiserFS: sda9: using ordered data mode
    [   44.440806] ReiserFS: sda9: journal params: device sda9, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
    [   44.442449] ReiserFS: sda9: checking transaction log (sda9)
    [   44.464768] ReiserFS: sda9: Using r5 hash to sort names

  10. #9
    Linux Guru D-cat's Avatar
    Join Date
    Jan 2009
    Location
    Bounce between Dover, NH - Shapleigh, ME
    Posts
    1,638
    I don't know how to see what is holding off on shutdown, since the logs I'd look at would be evaporated in the next boot. I do however know how to look at what is being loaded at boot and shutdown (live anyway, I don't know where Ubuntu keeps the bootlog, if it does)... it involves editing the /boot/grub/menu.lst file (use gksu gedit), on the kernel line, remove the word "splash" , save, and on next restart, you should see a live text screen of services as they come up and if they are successful ("done") or "Failed." This same screen should also be shown on shutdown.

  11. #10
    Just Joined!
    Join Date
    Jun 2009
    Posts
    5

    Problem resolved!

    Ok, the problem has been resolved, here is the explanation:
    The settings in /etc/rc0.d and /etc/rc6.d for umountnfs.sh, umountfs, umountroot, halt and reboot were wrong. Of course, this mess was not Ubuntu's fault, but mine - I recently played with the services, but I had no idea I have broken something else.

    Here is how I modified it:

    Code:
    $ ls -alsh /etc/rc0.d/
       0  lrwxrwxrwx   1 root root   22 2009-06-03 22:45 S31umountnfs.sh -> ../init.d/umountnfs.sh
       0 lrwxrwxrwx   1 root root   18 2009-06-03 22:45 S40umountfs -> ../init.d/umountfs
       0 lrwxrwxrwx   1 root root   20 2009-06-03 22:44 S60umountroot -> ../init.d/umountroot
       0 lrwxrwxrwx   1 root root   14 2009-06-03 22:20 S90halt -> ../init.d/halt
    
    $ ls -alsh /etc/rc6.d/
       0 lrwxrwxrwx   1 root root   22 2009-06-03 22:45 S31umountnfs.sh -> ../init.d/umountnfs.sh
       0 lrwxrwxrwx   1 root root   18 2009-06-03 22:45 S40umountfs -> ../init.d/umountfs
       0 lrwxrwxrwx   1 root root   20 2009-06-03 22:44 S60umountroot -> ../init.d/umountroot
       0 lrwxrwxrwx   1 root root   16 2009-06-03 22:38 S90reboot -> ../init.d/reboot
    halt and reboot should be the last executed scripts.

    Here are the commands I used in order to set the order of execution:
    1. Remove all current settings
    Code:
    $ sudo update-rc.d -f umountroot remove
    $ sudo update-rc.d -f umountfs remove
    $ sudo update-rc.d -f umountnfs.sh remove
    $ sudo update-rc.d -f halt remove
    $ sudo update-rc.d -f reboot remove
    2. Add again these scripts in the correct order:
    Code:
    $ sudo update-rc.d umountnfs.sh start 31 0 6 .
    $ sudo update-rc.d umountfs start 40 0 6 .
    $ sudo update-rc.d umountroot start 60 0 6 .
    
    $ sudo update-rc.d halt start 90 0 .
    $ sudo update-rc.d reboot start 90 6 .
    The above means:
    We will execute umountnfs.sh at first, next umountfs, next umountroot and finally halt in runlevel 0.
    Also, umountnfs.sh, umountfs, umountroot and finally reboot in runlevel 6.

    Thanks to all, who responded to this issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •