df error – ‘df: cannot read table of mounted file systems’

[root@host]# df -h
df: cannot read table of mounted file systems
[root@host]# cat etc/mtab
(nothing)
[root@host]# lvdisplay
Parse error at byte 6 (line 1): unexpected token

This is often related to a disk space issue. A post from insanelabs.com recommended freeing up space and then rebuilding /etc/mtab from /proc/mounts like so:
[root@host]# grep -v rootfs /proc/mounts > /etc/mtab
Seemed to do the trick, df is now returning expected results.

df - techpain.com

Share

Windows ‘forfiles’: Show or Delete files older than X days

Using ‘forefiles’ for file management and cleanup

forfiles - show or delete files older than X days

Use forfiles to show and/or delete files older than X amount of days:

/p = path
/s = subdirectories (recursive)
/m = mask
/d = days
/c = cmd to be run

Show .log files in C:LogFiles (recursively) older than 1 year:
forfiles /p C:LogFiles /s /m *.log /d -365 /c "cmd /c echo @file is at least 1 year old."

Remove .log files in C:LogFiles (recursively) older than 1 year:
forfiles /p C:LogFiles /s /m *.log /d -365 /c "cmd /c del @file"

Save as a .bat and schedule it.

Share

Ext2Fsd – Access Linux Partitions from Windows

PenDriveLinux.com has a great article on accessing Ext2 and Ext3 partitions from Windows. There are various other ways to do this, but a really quick, simple way (no messing around with mount commands or fstab!) is to use Ext2Fsd. The PenDriveLinux article has
detailed instructions, including screenshots, but it’s really as simple as:

1) Download Ext2Fsd and install.

2) Run Ext2Fsd, assign a drive letter to your Linux drive and reboot.

This makes me much happier about my dual boot configuration (Vista and Ubuntu 9.04), which was previously a pain to manage files between operating systems.

Share