Fsck

Не монтируется на запись раздел с сообщением /dev/ad0s1d: bad super block: values in super block disagree with those in first alternate. The following file system had an unexpected inconsistency: ufs: /dev/ad0s1d (/var)

fsck /dev/ad0s1d  Bad super block: values in super block disagree with those in first alternate

Look for alternate superblocks? [y/n] y

32 is not a file system superblock Search for alternate super-block failed. You must use the -b option to specify the location of an alternate super-block to supply needed information; see fsck(8). 

Finding possible alternate super blocks with the command: newfs -N /dev/ad0s1d (NOTE to noobs: make sure you use -N NOT -n to avoid creating a new file system.)

gives the numbers: 160, 376512, 752864, 1129216, 1505568, 1881920, 2258272, 2634624, 3010976, 3387328

Attempting to use an alternate superblock with the command: fsck_ffs -b  /dev/ad0s1d

fsck_ffs -b 160 /dev/ad6s1a  Alternate super block location: 160 fsck_ffs: cannot alloc 1284999392 bytes for inoinfo 
 * /dev/ad6s1a
 * Last Mounted on
 * Phase 1 - Check Blocks and Sizes

Проблема с файловой системой
 Trying to mount root from ufs:/dev/ad0s1a WARNING: / was not properly dismounted WARNING: R/W mount of / denied. Filesystem is not clean - run fsck WARNING: R/W mount of / denied. Filesystem is not clean - run fsck /: bad dir ino 965650 at offset 0: mangled entry /: bad dir ino 965650 at offset 512: mangled entry /: bad dir ino 965650 at offset 1024: mangled entry /: bad dir ino 965650 at offset 1536: mangled entry /: bad dir ino 965650 at offset 2048: mangled entry /: bad dir ino 965650 at offset 2560: mangled entry /: bad dir ino 965650 at offset 3072: mangled entry /: bad dir ino 965650 at offset 0: mangled entry /: bad dir ino 965650 at offset 512: mangled entry /: bad dir ino 965650 at offset 1024: mangled entry /: bad dir ino 965650 at offset 1536: mangled entry /: bad dir ino 965650 at offset 2048: mangled entry /: bad dir ino 965650 at offset 2560: mangled entry /: bad dir ino 965650 at offset 3072: mangled entry WARNING: attempt to net_add_domain(netgraph) after domainfinalize WARNING: R/W mount of / denied. Filesystem is not clean - run fsck WARNING: R/W mount of / denied. Filesystem is not clean - run fsck ng_pppoe[4]: session in wrong state ng_pppoe[4]: session in wrong state /: bad dir ino 965650 at offset 0: mangled entry /: bad dir ino 965650 at offset 512: mangled entry /: bad dir ino 965650 at offset 1024: mangled entry /: bad dir ino 965650 at offset 1536: mangled entry /: bad dir ino 965650 at offset 2048: mangled entry /: bad dir ino 965650 at offset 2560: mangled entry /: bad dir ino 965650 at offset 3072: mangled entry /: bad dir ino 965650 at offset 0: mangled entry /: bad dir ino 965650 at offset 512: mangled entry /: bad dir ino 965650 at offset 1024: mangled entry /: bad dir ino 965650 at offset 1536: mangled entry /: bad dir ino 965650 at offset 2048: mangled entry /: bad dir ino 965650 at offset 2560: mangled entry /: bad dir ino 965650 at offset 3072: mangled entry /: bad dir ino 965650 at offset 0: mangled entry /: bad dir ino 965650 at offset 512: mangled entry /: bad dir ino 965650 at offset 1024: mangled entry /: bad dir ino 965650 at offset 1536: mangled entry /: bad dir ino 965650 at offset 2048: mangled entry /: bad dir ino 965650 at offset 2560: mangled entry /: bad dir ino 965650 at offset 3072: mangled entry /: bad dir ino 965650 at offset 0: mangled entry /: bad dir ino 965650 at offset 512: mangled entry /: bad dir ino 965650 at offset 1024: mangled entry /: bad dir ino 965650 at offset 1536: mangled entry /: bad dir ino 965650 at offset 2048: mangled entry /: bad dir ino 965650 at offset 2560: mangled entry /: bad dir ino 965650 at offset 3072: mangled entry /: bad dir ino 965650 at offset 0: mangled entry /: bad dir ino 965650 at offset 512: mangled entry /: bad dir ino 965650 at offset 1024: mangled entry /: bad dir ino 965650 at offset 1536: mangled entry /: bad dir ino 965650 at offset 2048: mangled entry /: bad dir ino 965650 at offset 2560: mangled entry /: bad dir ino 965650 at offset 3072: mangled entry pid 1695 (ee), uid 0: exited on signal 11 WARNING: R/W mount of / denied. Filesystem is not clean - run fsck WARNING: / was not properly dismounted g_vfs_done:ad0s1a[READ(offset=2465537196032, length=16384)]error = 5 vnode_pager_getpages: I/O read error vm_fault: pager read error, pid 1705 (file) pid 1705 (file), uid 0: exited on signal 11 

%su - Password: su: Cannot open /etc/termcap. su: using dumb terminal settings.

file /etc/termcap Segmentation fault

vi /etc/rc.conf vi: No terminal database found

echo 'fsck_y_enable="YES"' >> /etc/rc.conf

mount -u -o ro /

reboot

This is because /etc/termcap is a link to /usr/share/misc/termcap. but /usr is not mounted at that moment. As DD said, ignore the message and go ahead.

ls -alhFoG /etc/termcap lrwxrwxrwx 1 root  wheel  -   23B Nov 14  2009 /etc/termcap@ -> /usr/share/misc/termcap

less /etc/termcap WARNING: terminal is not fully functional /etc/termcap: No such file or directory

cat /etc/termcap cat: /etc/termcap: No such file or directory

file /etc/termcap file: could not find any magic files!

Пропала целиком директория share ls /usr/share ls: /usr/share: No such file or directory

file /home/lke/share_copy.tar file: could not find any magic files!

Починил в итоге все переносом всей директории share с машины 7.0

Способ без рута?

A quick fix would be to scp /usr/share/misc/termcap from your home machine to ~/.termcap on the remote host. Then ssh into remote host and: echo "TERMCAP=$HOME/.termcap" >> ~/.ssh/environment


 * КОгда fsck помогает не сразу


 * FILE SYSTEM STILL DIRTY *****


 * FILE SYSTEM WAS MODIFIED *****

WARNING: R/W mount of / denied. Filesystem is not clean - run fsck mount reload of '/' failed: Operation not permitted
 * PLEASE RERUN FSCK *****

WARNING: R/W mount of / denied. Filesystem is not clean - run fsck mount:
 * REBOOT NOW *****

Проблемы в логах
Starting syslogd. Checking for core dump on /dev/ad0s1b... savecore: reboot after panic: ufs_dirbad: /: bad dir ino 8407 at offset 16384: mangled entry Apr 27 10:52:03 mars savecore: reboot after panic: ufs_dirbad: /: bad dir ino 8407 at offset 16384: mangled entry

Starting nginx. 2011/04/27 10:49:10 [emerg] 1658#0: mkdir "/var/tmp/nginx/client_body_temp" failed (2: No such file or directory)