parsed.org

Tips by tag: filesystem

Copying a filesystem by xinu on Jan 12, 2005 10:59 AM

Here is a way to copy an entire filesystem without descending down its subsumed mount points. This example uses the root filesystem:

$ find / -xdev | cpio -pm /desired/location
commandscopycpiofilesystemfindrootshell
Creating a Software RAID Device by cygnus on Feb 15, 2005 12:03 AM

After you've created two or more linux raid autodetect partitions, you can create a RAID device that uses them by running the mdadm command:

# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda2 /dev/hdb1
# mke2fs -j /dev/md0
commandsdebianfilesystemmdadmmke2fspartitionsraid
Network Forensics by cygnus on Jan 21, 2005 08:31 AM

You can use the lsof (LiSt Open Files) utility to view information about which processes own file handles on a system. Since sockets map to file descriptors, lsof will show you which processes own socket connections. If you see that your machine is connected to another on TCP port 6234 (source or dest) and you want to find out which process(es) are responsible for the connection, run:

# lsof -ni tcp:6234

Note that when run as an unprivileged user, lsof will only show you file descriptors that you have permission to see. You must run lsof as root to see everything in the kernel.

commandsconnectionsdebuggingdescriptorsfilesystemlsofmonitoringnetworkpermissionsprocesssocketsutilities
Unmounting a Frozen NFS Mount by cygnus on Feb 08, 2006 02:24 PM

If an NFS mount is frozen because the endpoint is unavailable, you can try a "lazy umount" on the mount to let the kernel take care of cleaning it up, rather than letting user-space processes wait on it:

# umount -l /path/to/mount

Additionally, you can use the NFS "soft" option when mounting the share to prevent hard locking of this kind; see nfs(5). Thanks to Kevin Turner for this tip.

brokenconfigurationfilesystemfrozengotchalazymountnfssoft
RSS