Manual fsck help in fedora


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Manual fsck help in fedora
# 1  
Old 09-30-2013
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  
Old 09-30-2013
Suggest you try rebooting and adding the following to the kernel command line via GRUB while booting:
Code:
fsck.mode=force

This User Gave Thanks to fpmurphy For This Post:
# 3  
Old 09-30-2013
If you are trying to unmount your own root partition, I think you'll have problems doing that...
You can force fsck to read mounted volumes, just don't let it make any changes (I think that's the -f and -n flags, but check your man page).

If you want to do a proper fsck of root including repairs, you'll really want to boot off something else (pop a boot disk in the drive and reboot) then run your fsck.

To easily get at /home, just boot up into single user / maintenance mode ('init', 'reboot' or 'halt' commands should do this for you - again, check your man pages for the flags to use to get single user mode).

A slightly more ghetto solution (I have been know to do this on occasion) is to hard power cycle the server (ie pull the cord out of the back rather than press the power button) which will force an fsck on bootup. That said, it might also corrupt the filesystem so, you know, maybe don't do this if the data really really matters. Smilie
# 4  
Old 10-06-2013
Quote:
Originally Posted by fpmurphy
Suggest you try rebooting and adding the following to the kernel command line via GRUB while booting:
Code:
fsck.mode=force

Is this similar to going into single user mode and unmounting your drives, then running fsck? Your way has less steps Smilie.

Quote:
Originally Posted by Smiling Dragon
If you are trying to unmount your own root partition, I think you'll have problems doing that...
You can force fsck to read mounted volumes, just don't let it make any changes (I think that's the -f and -n flags, but check your man page).

If you want to do a proper fsck of root including repairs, you'll really want to boot off something else (pop a boot disk in the drive and reboot) then run your fsck.

To easily get at /home, just boot up into single user / maintenance mode ('init', 'reboot' or 'halt' commands should do this for you - again, check your man pages for the flags to use to get single user mode).

A slightly more ghetto solution (I have been know to do this on occasion) is to hard power cycle the server (ie pull the cord out of the back rather than press the power button) which will force an fsck on bootup. That said, it might also corrupt the filesystem so, you know, maybe don't do this if the data really really matters. Smilie
Single user mode worked Smilie.

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.
# 5  
Old 10-06-2013
If by Single user mode you mean the "Emergency"- or "Multiuser"-mode/.target then: no.
Those are 'init 1' or 'init 3', while the DE requires Graphical.target (init 5).

Init 1: Wont let you login, you're automaticly root (no other TTY's)
Init 3: Requires textual login for any passed loginname (multiple TTY's)
Init 5: Should prompt you with a graphical login screen (multiple TTY's)

By pressing ctrl+alt+f2 you're simply accessing TTY 2.
By default, a distro 'supports' (out of the box) only 1 TTY to display a DE.
(of course this can be changed, but requires some experience)

Accessing another TTY from DE/GUI, will have a very 'diffrent' environment than you face in emergency(.target) stage,
in which usualy /home is not mounted, wifi drivers are not loaded and similar...

Hope this helps?

Last edited by sea; 10-06-2013 at 08:16 PM..
# 6  
Old 10-07-2013
Quote:
Originally Posted by cokedude
Single user mode worked Smilie.
Awesome Smilie Smilie
Quote:
Originally Posted by cokedude
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.
Yeah, single user mode is, well, a mode with only one user Smilie
It's like a barebones boot with only the very basic stuff loaded to get the OS going. You can actually set more stuff to start up when you boot single-user but that's asking for trouble as the whole point of single-user mode is to be as basic as possible.

The main differences are:
* There's only the root user and only one user at a time, not multiuser at all (some OS's kind of cheat here though)
* Most filesystems don't mount, and most processes don't start, so it's easier to work on the filesystems without other stuff getting in the way.

You can exit single user mode by simply logging out (exit or ^d) and it should carry on up to multi-user. That said, I actually prefer to reboot round to multi-user instead but that may be me just being overly paranoid Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

unable to repair the / filesystem. Run fsck manually (fsck -F ufs /dev/rdsk/c1t0d0s0)

What can I fix this issue? I have ran below commands but everything is same.:confused: WARNING: Last shutdown is later than time on time-of-day chip: check date. The / file system (/dev/rdsk/c1t0d0s0) is being checked WARNING - unable to repair the / filesystem. Run fsck manually (fsck -F... (4 Replies)
Discussion started by: getrue
4 Replies

2. Red Hat

fedora grub help, moving to tri boot (XP, ubuntu, fedora soemething)

I will shortly be adding a fedora flavor to my devel box. I currently have XP (installed first on an ssd), ubuntu 10.04 (installed second on the first partition of a platter drive), and I want to add either Cent or SL on the second partition of the platter drive. I will probably also want to... (0 Replies)
Discussion started by: LMHmedchem
0 Replies

3. Shell Programming and Scripting

No Manual Entry

Hi, While executing the following command i am getting output as command not found. iostat output: command not found Also, man iostat is displaying "NO Manual Entry" Why is it so? (5 Replies)
Discussion started by: salil2012
5 Replies

4. Shell Programming and Scripting

Exiting a manual

I'm sure it's really easy, but I have searched on Google and on the forums and haven't found anything. For instance, if I open the grep manual (man grep), I can't close it. I've tried ctrl+c, ctrl+x, scrolling to the bottom of the manual. How can I exit the manual without closing the shell? ... (8 Replies)
Discussion started by: dennis89
8 Replies

5. Shell Programming and Scripting

Need help with a manual task

I have an ASCII file that I receive on a monthly bases that is fixed length. I break the file into separate files based on a 5 character numerical sequence. I have 20 different sequences I have to find. the input file looks something like this xy-ins 2008yuthnrlsinrthsntwilgrha33260001... (4 Replies)
Discussion started by: jcalisi
4 Replies

6. Shell Programming and Scripting

NDM manual

Hi, Can any of you tell me how to get this ndm manual stuff? I need it to know specific error ids and descriptions Thanks, Vinodhini (1 Reply)
Discussion started by: vinodhini4
1 Replies

7. Linux

Dual Boot Win XP And Fedora with Fedora Installed First

Hi everyone, I hope this question goes here. Anyways, I have a unique situation where my friend's comp has Fedora installed and wants to add Win XP as a dual boot without formatting the drive. Is it possible to create a partition on the current hard drive and then install win xp? I couldn't find... (4 Replies)
Discussion started by: eltinator
4 Replies

8. UNIX for Dummies Questions & Answers

fsck - what should be done?

I want to use fsck to check and repair my linux system. When I use this command, what do I need to pay attention to or what should I do to make job running successfully. Thanks for your inputs for a newbie. (3 Replies)
Discussion started by: duke0001
3 Replies

9. UNIX for Dummies Questions & Answers

No manual entry for

I don't seem to be able to get man pages up for any command. When I try the "No manual entry for..." message is displayed. When checking my $MANPATH variable I get the following /opt/SUNconn/man: However, when I check this directory it doesn't exist. Searching for any man directories results... (3 Replies)
Discussion started by: FattyLumpkin
3 Replies
Login or Register to Ask a Question