e2fsck

Options
MickleSong
MickleSong Posts: 4 image  Freshman Member
First Comment

Hello!

dmesg offers e2fsck running: "EXT4-fs (dm-2): warning: mounting fs with errors, running e2fsck is recommended"

But dm-2 mounted. I tried:

~ # umount -f /dev/md2
umount: /i-data/9dba6a2b: target is busy

Well. Can I add this command to rc.shutdown file?

After this:

[quote]/bin/umount cat /proc/mounts|grep /dev/md|awk '{print $2}' 2>/dev/null
/bin/umount cat /proc/mounts|grep /dev/sd|awk '{print $2}' 2>/dev/null
/bin/umount cat /proc/mounts | grep "/dev/mapper/vg_" | awk '{print $2}' 2>/dev/null
/usr/sbin/vgchange -an
/bin/umount /etc/zyxel
mdadm -Ss[/quote]

All Replies

  • Mijzelf
    Mijzelf Posts: 2,989 image  Guru Member
    250 Answers 2500 Comments Friend Collector Eighth Anniversary

    Yes, you can. But it's more convenient to add a telnet daemon, followed by some blocking function to stop the shutdown. This way you can open a shell and do the work, and more important, read the error messages. As dm-2 is a logical volume, you'd better inject this before 'vgchange', as that stops the logical volumes:

    /bin/umount cat /proc/mounts | grep "/dev/mapper/vg_" | awk '{print $2}' 2>/dev/null

    /bin/telnetd

    /bin/sh

    /usr/sbin/vgchange -an

    Check if telnetd is in /bin. Could also be /sbin. After a reboot the rc.shutdown is back to stock. It's in the initramfs.

  • MickleSong
    MickleSong Posts: 4 image  Freshman Member
    First Comment

    Thanks. How I can continue shutdown after that I check hdd drives ?

  • Mijzelf
    Mijzelf Posts: 2,989 image  Guru Member
    250 Answers 2500 Comments Friend Collector Eighth Anniversary

    Wow. Has e2fsck been running for 11 years?

    Anyway, you can continue shutdown by killing the blocking shell. The command 'killall sh' should do. Problem is that it will also kill the shell you are using, and if that comes first, it will kill killall either. So you should redirect the pipes:

    killall sh </dev/null >/dev/null 2>&1 &

    But as the filesystem are not mounted, you can also just cut the power.

  • MickleSong
    MickleSong Posts: 4 image  Freshman Member
    First Comment

    well.. but my running telnet session where I enter "killall sh </dev/null >/dev/null 2>&1 &" will not interfere with shutdown ?

  • Mijzelf
    Mijzelf Posts: 2,989 image  Guru Member
    250 Answers 2500 Comments Friend Collector Eighth Anniversary

    No. The shell will close. The telnet daemon will keep running, but that won't stop the kernel from switching off the power.

  • MickleSong
    MickleSong Posts: 4 image  Freshman Member
    First Comment

    Thank you! All worked successfully!

Consumer Product Help Center