FSCK

Pedro Fernandes Macedo webmaster at margo.bijoux.nom.br
Fri Jun 18 01:36:55 UTC 2004


Jim Cornette wrote:

> littleguru wrote:
>
>> Hello
>>
>> I have several questons:
>> 1-when I  start mylinux server and it said that it was not shutdown 
>> properly , do you want to check ?
>> but I ran fsck manually before and it shouldn't ask me any more. is 
>> there any difference between fsck at startup and the one I ran in 
>> maintenance mode, because the server couldnt boot and entered in 
>> maintenace mode.
>
>
> The easiest way to force your computer to do a filecheck is to run the 
> below command as root.
>
> shutdown now -Fr
>
> This will reboot your computer, then force a filecheck.
>
> Dropping into maint. mode could be caused by trying to mount a volume 
> in /etc/fstab as a type that it is not. I believe setting the last two 
> numbers to anything but zeroes will drop you to the shell.
>
>
You'll be only dropped to maintenance mode if there is a serious error , 
like wrong filesystem type. The last two numbers are used by dump and 
fsck. From the man pages:

> The  fifth  field,  (fs_freq),  is  used  for  these filesystems by the
>        dump(8) command to determine which filesystems need to be  
> dumped.   If
>        the  fifth  field  is not present, a value of zero is returned 
> and dump
>        will assume that the filesystem does not need to be dumped.
>
>        The sixth field, (fs_passno), is used by the fsck(8) program 
> to  deter-
>        mine the order in which filesystem checks are done at reboot 
> time.  The
>        root filesystem should be specified with a fs_passno of  1,  
> and  other
>        filesystems  should  have a fs_passno of 2.  Filesystems within 
> a drive
>        will be checked sequentially, but filesystems on different 
> drives  will
>        be  checked  at  the  same time to utilize parallelism 
> available in the
>        hardware.  If the sixth field is not present or zero, a value  
> of  zero
>        is  returned  and fsck will assume that the filesystem does not 
> need to
>        be checked.
>
>        The proper way to read records from fstab is to use the 
> routines getmn-
>        tent(3).


> Run the command mount. This will give you an output with the currently 
> mounted filesystems. I unmount the filesystems that I try to check. I 
> believe that you will be prompted to unmount the partition before 
> fscking.
>
>
Most filesystems require that the filesystem is not mounted before the 
check. Others , like xfs , have the option to check the filesystem if it 
is mounted read-only.

>> 3- can I find another software other  than fsck  to check and solve 
>> hardware problem ?
>> I found knoppix but dont have any experience with that .
>
Probably you'll find none. If the problem is corrupted FS data , then 
only fsck can fix it (or you can try debugfs , but it wont be a trivial 
task). If the problem is in the disk itself , you can try to run the 
software from the disk manufacturer. But , chances are that if there are 
bad blocks , you may loose data , unless the program is smart enough to 
move the data to another block.

>> 4-what is the best way to transfer data from crashed hard to the new 
>> one?
>> fsdump ? or just cp ?I use fedora core one and need some thing that 
>> untar or restore every thing
>> on home directory .
>
I dont like the idea of using dump (specially after using ufsdump and 
now being unable to restore the files on any linux system). The idea of 
dumping the whole filesystem contents bothers me. Specially when all you 
need is the file , its permissions and any ACL that exists (if one 
exists). The way I usually do is using tar -cfv --preserve-permissions  
--same-owner file.tar inputfiles .

--
Pedro Macedo





More information about the fedora-list mailing list