<---- template headericclude ----->
manual fsck help in fedora
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 15 of 15
  1. #1
    Join Date
    Jan 2011
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    manual fsck help in fedora

    I am trying to do a manual fsck in Fedora. So far I have not had any luck. I have tried the easy way like this.

    Code:
    sudo touch /forcefsck
    Since that didn't work I tried the manual way.

    Code:
    sudo fsck.ext4 /dev/mapper/vg_hi-lv_home
    sudo fsck.ext4 /dev/mapper/vg_hi-lv_root
    Since I got mounted errors I tried to unmount them next.
    Code:
    sudo umount /dev/mapper/vg_hi-lv_root
    sudo umount /dev/mapper/vg_hi-lv_home
    I got the usual busy messages so I tried to fix that with these commands.
    Code:
    sudo fuser -km /dev/mapper/vg_hi-lv_root
    sudo fuser -km /dev/mapper/vg_hi-lv_home
    Every time I run the commands above it logs me out. Can I please have some ideas on what to try next?

  2. #2
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    First, you can't unmount the root.

    second, you can unmount /home, but to do so it must be idle - meaning no process may have it open as a working directory, so do something like changing your working directory to /tmp first.

    To do an fsck on root requires either the initrd to do it, or to boot a rescue disk and do it from there - the root used for the rescue system is not the same as the normal root - thus it shouldn't be mounted (or if it is, you can unmount it as it will be on /mnt).

  3. #3
    Join Date
    Jan 2011
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    Quote Originally Posted by jpollard
    First, you can't unmount the root.

    second, you can unmount /home, but to do so it must be idle - meaning no process may have it open as a working directory, so do something like changing your working directory to /tmp first.

    To do an fsck on root requires either the initrd to do it, or to boot a rescue disk and do it from there - the root used for the rescue system is not the same as the normal root - thus it shouldn't be mounted (or if it is, you can unmount it as it will be on /mnt).
    That is the purpose of this.

    Code:
    sudo fuser -km /dev/mapper/vg_hi-lv_root
    sudo fuser -km /dev/mapper/vg_hi-lv_home

  4. #4
    Join Date
    Jun 2010
    Location
    Lost...
    Posts
    1,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    I usually add 'forcefsck' in the grub command line for this. I think there is a new parameter now, but it sill should work.
    Edit: by the way, I think that the trigger file is '/.autofsck', but not sure.
    :confused:

  5. #5
    Join Date
    Jan 2011
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    Quote Originally Posted by Skull One
    I usually add 'forcefsck' in the grub command line for this. I think there is a new parameter now, but it sill should work.
    Edit: by the way, I think that the trigger file is '/.autofsck', but not sure.
    When you say grub command line do you mean this?

    http://www.computersecuritystudent.c...EDORA/lesson2/


    Or do you mean the grub file?

    /boot/grub/grub.conf

  6. #6
    Join Date
    Jun 2010
    Location
    Lost...
    Posts
    1,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    yes, the first one since you do not want the change to be permanent.
    :confused:

  7. #7
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    Quote Originally Posted by COKEDUDE
    That is the purpose of this.

    Code:
    sudo fuser -km /dev/mapper/vg_hi-lv_root
    sudo fuser -km /dev/mapper/vg_hi-lv_home
    Well, since it logged you out, your login process must have had the filesystem busy. root will ALWAYS be busy - every daemon is open from it and init is also open from it (aka systemd). Successfully killing systemd will shut the system down...

  8. #8
    Join Date
    Jul 2011
    Location
    Birmingham, UK
    Age
    41
    Posts
    2,759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    You can check / without a live CD as long as it is mounted read-only. You need to be in whatever Systemd’s equivalent of run-level 1 is. Try adding “ 1” to the kernel command-line in GRUB, or run something like “systemctl isolate rescue.target” on a freshly-booted system.

  9. #9
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    Quote Originally Posted by Gareth Jones
    You can check / without a live CD as long as it is mounted read-only. You need to be in whatever Systemd’s equivalent of run-level 1 is. Try adding “ 1” to the kernel command-line in GRUB, or run something like “systemctl isolate rescue.target” on a freshly-booted system.
    Note: if something is fixed on a read-only mount, you must reboot as anything else could/will just corrupt the filesystem again.

  10. #10
    Join Date
    Jul 2011
    Location
    Birmingham, UK
    Age
    41
    Posts
    2,759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    CODEDUKE: I’ve just noticed your screen-shot is Fedora 14—is that the version that you’re actually using? If so, use “telinit 1” instead of the “systemctl” command.

  11. #11
    Join Date
    Jul 2011
    Location
    Birmingham, UK
    Age
    41
    Posts
    2,759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    Quote Originally Posted by jpollard
    Note: if something is fixed on a read-only mount, you must reboot as anything else could/will just corrupt the filesystem again.
    Good catch; I forget to mention that.

  12. #12
    Join Date
    Aug 2009
    Posts
    11,397
    Mentioned
    98 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    The new and recommended way now to force a file system check at boot is to add a kernel parameter.

    Just edit your kernel line when you boot and append this parameter to your kernel line.

    fsck.mode=force

    But, if this is for Fedora 14, then I don't believe adding the parameter to your kernel line will work.

    Also, I believe creating the /forcefsck or the fsck.mode=force parameter only works on file systems you have set in your /etc/fstab to check.

  13. #13
    Join Date
    Jan 2011
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    Quote Originally Posted by Gareth Jones
    You can check / without a live CD as long as it is mounted read-only. You need to be in whatever Systemd’s equivalent of run-level 1 is. Try adding “ 1” to the kernel command-line in GRUB, or run something like “systemctl isolate rescue.target” on a freshly-booted system.
    It worked in single user mode.

    Is there a difference between single user mode, pressing ctrl+alt+f2 and logging into root, or using sudo -i? I figured pressing ctrl+alt+f2 and logging into root, or using sudo -i would have the same effect as using single user mode.

    Quote Originally Posted by Gareth Jones
    CODEDUKE: I’ve just noticed your screen-shot is Fedora 14—is that the version that you’re actually using? If so, use “telinit 1” instead of the “systemctl” command.
    On this system I have Fedora 15. I was trying to respond to Skull One, so I just googled fedora single user mode and used that screenshot since it was the first one I found.

    I have used telinit 1 a few times and it works. Didn't red hat get rid of telinit and switch over to systemctl in Fedora 16?

    Quote Originally Posted by DBelton
    The new and recommended way now to force a file system check at boot is to add a kernel parameter.

    Just edit your kernel line when you boot and append this parameter to your kernel line.

    fsck.mode=force

    But, if this is for Fedora 14, then I don't believe adding the parameter to your kernel line will work.

    Also, I believe creating the /forcefsck or the fsck.mode=force parameter only works on file systems you have set in your /etc/fstab to check.
    How would I set my /etc/fstab to do that?

  14. #14
    Join Date
    May 2011
    Location
    Confoederatio Helvetica (Swissh)
    Age
    44
    Posts
    4,526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    You mentioned:
    Code:
    sudo touch /forcefsck
    didnt work...

    Did you actualy reboot after?
    * Shell Wrapper and Runtime Modifier (SWARM): https://github.com/sri-arjuna/SWARM
    * Yet Another Simple Script Installer (YASSI): https://forums.fedoraforum.org/showthread.php?323099
    * EFI Cheatsheet :: http://forums.fedoraforum.org/showthread.php?t=298546
    * Windows 8+ & Fedora 20+ Dualboot :: http://forums.fedoraforum.org/showthread.php?t=298161

  15. #15
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: manual fsck help in fedora

    Quote Originally Posted by COKEDUDE
    It worked in single user mode.

    Is there a difference between single user mode, pressing ctrl+alt+f2 and logging into root, or using sudo -i? I figured pressing ctrl+alt+f2 and logging into root, or using sudo -i would have the same effect as using single user mode.
    Of course. All ctrl-alt-f2/3/4/... does is switch to a virtual console terminal (usually f2/... through f6). You are still in multi-user mode with all services active.

    Single user mode goes to a console terminal only, with root mounted read only, and NO services. Which also means no network. It really means "single user" as the only login that can do anything is root. If enabled, the only password that would be requested is roots password. USUALLY (at least with fedora) single user mode comes up with a root shell session only.

Similar Threads

  1. manual fsck of an LVM
    By steve941 in forum Using Fedora
    Replies: 1
    Last Post: 11th September 2005, 02:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]