Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jul 2003 05:46:39 -0400
From:      "akanwar@digitarchy.com" <akanwar@digitarchy.com>
To:        wmoran@potentialtech.com, freebsd-questions@freebsd.org
Subject:   Re: running fsck on root filesystem
Message-ID:  <157240-2200370694639241@M2W071.mail2web.com>

next in thread | raw e-mail | index | archive | help

Hi Bill, 

Thanks for a good reply. Please see my replies inline.

akanwar@digitarchy.com wrote:
> I have a remote machine on whose boot disk I want to run fsck. Is there
any
> way of booting freebsd form the network and then getting into fixit mode
> without a cdrom or a floppy ?
> 
> I am using pxeboot so far. What is happening is that when I put
> "installFixitHoloShell" in the install.cfg then sysinstall throws me to
the
> shell that is VERY barebones. I can't run even a 'ls'. In this case how do
> I figure out what disk slices I have in the system and on which I want to
> run fsck ?

A lot you don't say here.  One thing is _why_ you want to do this.  Another
is what you want to do.  Your description is pretty vague.

---* Sorry I erred on the side of being laconic. Here is the situation: I
have a file in /usr/something/file. Whenever I try to cp it to any other
location, the machine freezes! I have tried a tar on the file (machine
freezes) and a cat filename (same result). Here is a truss on the copy

rack1-104.sjc# truss cp ft-v05.2003-06-30.104501-0700 /tmp
stat("/tmp",0xbfbffb90)                          = 0 (0x0)
umask(0x1ff)                                     = 18 (0x12)
umask(0x12)                                      = 511 (0x1ff)
readlink("/etc/malloc.conf",0xbfbff984,63)       ERR#2 'No such file or
directory'
mmap(0x0,4096,0x3,0x1002,-1,0x0)                 = -2012909568 (0x88057000)
break(0x806b000)                                 = 0 (0x0)
break(0x806c000)                                 = 0 (0x0)
break(0x806d000)                                 = 0 (0x0)
break(0x806e000)                                 = 0 (0x0)
stat("ft-v05.2003-06-30.104501-0700",0x806d160)  = 0 (0x0)
stat("/tmp/ft-v05.2003-06-30.104501-0700",0xbfbffa84) ERR#2 'No such file
or directory'
open("ft-v05.2003-06-30.104501-0700",0x0,00)     = 3 (0x3)
open("/tmp/ft-v05.2003-06-30.104501-0700",0x601,0100644) = 4 (0x4)
mmap(0x0,5941955,0x1,0x1,3,0x0)                  = -2012905472 (0x88058000)
<dies>


If I do a cat here is what happens:

rack1-104.sjc# truss cat ft-v05.2003-06-30.104501-0700 > /dev/null
open("ft-v05.2003-06-30.104501-0700",0x0,00)     = 3 (0x3)
fstat(1,0xbfbffb30)                              = 0 (0x0)
readlink("/etc/malloc.conf",0xbfbffa90,63)       ERR#2 'No such file or
directory'
mmap(0x0,4096,0x3,0x1002,-1,0x0)                 = -2012909568 (0x88057000)
break(0x805a000)                                 = 0 (0x0)
break(0x805b000)                                 = 0 (0x0)
read(0x3,0x805a000,0x1000)                       = 4096 (0x1000)
write(1,0x805a000,4096)                          = 4096 (0x1000)
read(0x3,0x805a000,0x1000)                       = 4096 (0x1000)
write(1,0x805a000,4096)                          = 4096 (0x1000)
read(0x3,0x805a000,0x1000)                       = 4096 (0x1000)
write(1,0x805a000,4096)                          = 4096 (0x1000)
read(0x3,0x805a000,0x1000)                       = 4096 (0x1000)
write(1,0x805a000,4096)                          = 4096 (0x1000)
read
<dies>

At this point the machine stops responding to any console or network
connections. After a while it spews ethernet flow control frames,
indicating that the interrupts from the NIC to the kernel are not being
serviced.

I did a memory check on the box and it looks ok. So now I suspected the
disk...and was looking for a good way to test it.

>> fsck is always run on the root filesystem at boot time, in preen mode. 
If
you're having some sort of filesystem errors, setting fsck_y_enable="YES" in
/etc/rc.conf will cause the startup scripts to automatically run 'fsck -y'
if
fsck fails in preen mode.

---* This is a good suggestion. I need to run it on the /usr slice though.


>> If you want to change this behaviour, you _could_ edit /etc/rc to change
the
default handling.

>> From any shell, you should be able to mount filesystems readonly.  When
mounted readonly, you can safely run fsck.  Use 'mount -r /mountpoint'. 
Many
of your commands are not on the root filesystem, so you may need to mount
(for example) /usr before you can execute certain commands.


---* Problem: here is the fstab:
# Device                Mountpoint      FStype  Options         Dump   
Pass#
/dev/ad0s1a             /               ufs     rw              1       1
/dev/ad0s1f             /tmp            ufs     rw              2       2
/dev/ad0s1g             /usr            ufs     rw              2       2
...

When I get to the shell (via sysinstall), I do

# fsck /dev/ad0s1g             
Can't stat /dev/ad0s1g: No such file or directory
Can't stat /dev/ad0s1g: No such file or directory

Why can I not see these disks? Is the device path something different. I
guees the solaris equivalent of "device to fsck". 


So there ...a more comprehensive summary :).

I will be thankful for any help/suggestions.

-ansh

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?157240-2200370694639241>