You are not logged in.

#1 2004-01-11 03:43:18

jlowell
Member
Registered: 2003-08-10
Posts: 270

Doing A File System Check - Some Confusion

Whenever in the past I've done a file system check as part of a routine system administration check, as root in a console I've run

telinit 1

and after logging in as root, run

umount /dev/sdc6
reiserfs --check --logfile check.log /dev/sdc6
exit

and that was it.

This is the first time I've attempted this kind of thing with Arch and while I get started perfectly well, when I attempt to unmount the file system I want to check I get a "busy" error. I thought that going back into run level 1 got me out of that kind of trouble but apparently not. What do I have to do to run this file system check; /dev/sdc6 is the root partition.

I'm lost.

jlowell

Offline

#2 2004-01-11 12:29:43

farphel
Forum Fellow
From: New Hampshire - USA
Registered: 2003-09-18
Posts: 250
Website

Re: Doing A File System Check - Some Confusion

As I'm sure you know, you can only unmount a filesystem when it is not in use.  To find out what programs/processes are using your filesystem, try running 'lsof /dev/sdc6'.

Your best bet for checking the root filesystem will be on boot up into single user mode so that the filesystem is still in read-only mode and before any processes have been started.


Follow the link below, sign up, and accept one promotional offer.  If I can get five suckers (err... friends) to do this, I'll get a free iPod.  Then you too can try to get a free iPod. Thanks! http://www.freeiPods.com/?r=11363142

Offline

#3 2004-01-11 18:50:41

jlowell
Member
Registered: 2003-08-10
Posts: 270

Re: Doing A File System Check - Some Confusion

Hi farphel,

Did you change this spelling recently from farfel? Maybe I'm getting too old and the memory is shot but I thought you'd spelled it farfel in the past, same avatar.

Anyway, thanks for your reply. And, yes, I did know that you can't unmount an active process, but I did think telinit 1 took me into a read only condition. Bad guess, eh? smile

This one hasn't been easy. I've tried everything, lazy umounts, for example, which work, but after which the system refuses to pick up the devise so that I can mount it read only and go from there. I'm about googled and man-paged out (five hours last night). Thanks for the idea.

Now, how do I get the system to boot into single user mode? Can this be done via grub once their splashscreen appears? I'll try that and see and get back to you.

jlowell

Offline

#4 2004-01-11 19:38:54

jlowell
Member
Registered: 2003-08-10
Posts: 270

Re: Doing A File System Check - Some Confusion

farphel,

Well, booting into grub, running c and hitting Tab doesn't help but googling does. So that someone else that wants an answer to this question will have it, boot into grub, select e for edit, select the kernel line and add the separate word single to it and reboot. You'll have to re-edit to remove the word single after the file system check is complete.

Why this process requires all this work baffles me. My first experiences with a working Linux system were with SuSE 7.3 and you could move directly into single user mode with telinit 1 from the command line, umount the root partition and run a file system check without thinking about it. While I'm not going to reinstall SuSE 7.3 so as to determine how that was achieved, I do think that this was a capability of older Linux versions and not present ones because I've had the same problem with Gentoo, another distro I use here. Perhaps a case of progress not being progressive, eh?

Regards, farphel.

jlowell

Offline

#5 2004-01-11 19:55:46

zen_guerrilla
Member
From: Greece
Registered: 2002-12-22
Posts: 259

Re: Doing A File System Check - Some Confusion

You can also

$ telinit 1
$ mount / -o remount,ro

do the check stuff & then

$ mount / -o remount,rw
$ telinit 3

Offline

#6 2004-01-11 20:08:14

jlowell
Member
Registered: 2003-08-10
Posts: 270

Re: Doing A File System Check - Some Confusion

farphel & zen_gorilla,

Well I shot off my mouth too fast about getting this to work by doing a kernel line edit with grub. Truth be known, it doesn't work that way at all because while you'll get into single user mode OK, the preceeding  file system mount read only, file system check and file system mount steps have already taken place. You get the request for the root password, etc. but you're no better off than if you ran telinit 1 from a console. My apologies to anyone taking my instructions above and trying to do a filesystem check this way, it simply doesn't work.

Zen, I'm going to try your solution next. I'll get back to you in a few minutes. Thanks for the reply!

jlowell

Offline

#7 2004-01-11 20:33:31

jlowell
Member
Registered: 2003-08-10
Posts: 270

Re: Doing A File System Check - Some Confusion

zen_gorilla,

OK, here's what I've done: From a console

telinit 1

and logged on with root password.

mount / -o remount, ro

and get output

mount: / is busy

If I try a lazy umount with subsequent attempt to mount the device, the device isn't recognized no matter if I call it /dev/sdc6 or /dev/discs/disc2/part6. Where do we go from here? It's looking to me that the only way to do a file system check on this system is via the pre-arranged boot script method. What ever happened to flexibilty? smile

jlowell

Offline

#8 2004-01-11 21:36:50

zen_guerrilla
Member
From: Greece
Registered: 2002-12-22
Posts: 259

Re: Doing A File System Check - Some Confusion

Ok, I figured it out

$ telinit 1
$ /etc/rc.d/klogd stop
$ /etc/rc.d/syslogd stop
$ mount / -o remount,ro

and it should work

Offline

#9 2004-01-11 21:45:49

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Doing A File System Check - Some Confusion

jlowell wrote:

mount / -o remount, ro

no space, very important

mount / -o remount,ro


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#10 2004-01-11 22:17:45

jlowell
Member
Registered: 2003-08-10
Posts: 270

Re: Doing A File System Check - Some Confusion

zen_gorilla & Xentac,

Xentac,

Happy to report that was a typo. Thanks for your eagle-eye!

Zen,

That did it!

The correct sequence, then, from a console is:

telinit 1
/etc/rc.d/klogd stop
/etc/rc.d/syslogd stop
mount / -o remount, ro
umount /dev/sdc6
reiserfsck --check /dev/sdc6
reboot

I chose in this way to let the system re-mount /dev/sdc6 rw after the check as you can see to make sure I hadn't borked the boot scripts somehow. I hadn't. Also, I'm happy to report the file system was healthy.

Many thanks for the analytical work and the command line instructions! This way when I do my regular maintenance I won't be left guessing if I've got a sound file system.

Best regards to all three of you, farphel included.

jlowell

Offline

#11 2004-01-12 10:37:29

zen_guerrilla
Member
From: Greece
Registered: 2002-12-22
Posts: 259

Re: Doing A File System Check - Some Confusion

Enter the uptime-junkie area smile. You can also

mount / -o remount,rw
mount /dev/sdc6
telinit 3

and get back in action without restarting smile.

Offline

Board footer

Powered by FluxBB