1836585 Members
2276 Online
110102 Solutions
New Discussion

fsck on "/"

 

fsck on "/"

Hi guys,
Do you know a way to run a fcsk on "/" to fix an open file handle issue?
I've deleted a ftp process which was writing a file on / and now is accusing file system full but it isn't really full...
I've already booted the box...

Thanks in advance,
Rafael
4 REPLIES 4
Bruce Regittko_1
Esteemed Contributor

Re: fsck on "/"

Hi,

If the filesystem is HFS, then yes, you can run fsck on /, BUT you really, really, REALLY want to do it from single user mode with a very quiet system and then only after a new backup is made. See the man page for fsck_hfs(1m) for the appropriate syntax.

If your root is JFS, then you cannot run fsck on / (or any filesystem) while it is mounted. You will need to boot up a recovery shell off the installation cd and then run it's fsck on your root device.

--Bruce
www.stratech.com/training
Carsten Krege
Honored Contributor

Re: fsck on "/"

If you rebooted, you won't have an open file problem anymore. I don't believe that you will need an fsck.

I would check the size of your files in the root filesystem, e.g. use

# find / -xdev -type f | xargs du -s | sort -n >/tmp/outfile

to get a list of regular files in the root file system sorted by size. Perhaps you can figure out a file that shouldn't be there.

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Valkiria Santos
Frequent Advisor

Re: fsck on "/"

Hello,

You can check if exist any file in /dev/rmt with permission not begin with c character , files like a -rxrwxrwx root sys /dev/rmt/0m or -rxrwxrwx root sys /dev/rmt/om. You can remove file like this, then I belive you will get free space on /
You can execute fsck on / following the hint from Bruce. Go ahead.

Valkiria
Bill Hassell
Honored Contributor

Re: fsck on "/"

If bdf reports that / is indeed full, then you need to first identify the big directories. A directory with 1000 small files can just as easily fill / as one big file. Use this:

du -xk / | sort -rn > /var/tmp/du.root

Then look at /var/tmp/du.root for the biggest directory. Then look inside the biggest directories for files that need to be removed. Use this to list files by size:

ll /some_directory | sort -rnk5 | more


Bill Hassell, sysadmin