Tuning and debugging filesystems

Three tools are particularly important: dumpe2fs, tune2fs and debugfs. dumpe2fs shows info about ext2 and ext3 partitions. It can be safely run on a filesystem that’s currently mounted: dumpe2fs [options] [device] -h omits info about group descriptors, useful for advanced debugging. Inode count it’s the number of inodes supported by the filesystem. Every inode contains… Continue reading “Tuning and debugging filesystems”

Common partitions and filesystem layout

swap not mounted, 1-2 times the RAM size /home holds users’ data files /boot holds critical boot files /usr holds most Linux program data files /usr/local holds Linux program and data files that are unique to the current installation /opt third part packages /var misc files associated with day-to-day tasks /tmp temporary files created by… Continue reading “Common partitions and filesystem layout”

Linux partitioning system

MBR was the most used until 2010, it stores data in the first sector of the disk and it’s limited to 2TiB partitions. GPT (GUID Partition Table) has much higher limits. MBR partitions The original x86 allowed only four partitions, but this scheme was extended. The new scheme uses three partition types: primary partitions extended… Continue reading “Linux partitioning system”

Linux USB drivers

UHCI (Universal Controller Interface) and OHCI (Open Host Controller Interface) handle USB 1.x devices. lsusb reveals basic info on USB devices. Its options: -s [[bus]:[devnum]] restrict output to the specified device -D [filename] display info about the device in [filename]; this file should be in /proc/bus/usb

Kernel modules

/lib/modules stores kernel drivers and Linux loads the modules it needs when it boots. lsmod shows modules that are currently loaded. Module Size Used by ccm 20480 6 ip6t_rpfilter 16384 1 ip6t_REJECT 16384 2 nf_reject_ipv6 16384 1 ip6t_REJECT xt_conntrack 16384 13 ip_set 36864 0 nfnetlink 16384 1 ip_set ebtable_nat 16384 1 ebtable_broute 16384 1 bridge… Continue reading “Kernel modules”

Coldplug and hotplug devices

There are several utilities that can help managing hotplug devices: sysfs, virtual filesystem mounted at /sys. It exports info about devices so that user-space utilities utilities can access the information; HAL daemon, hardware abstraction layer. hald is a daemon that runs all the time and provides info about the available hardware; D-Bus, desktop bus. It… Continue reading “Coldplug and hotplug devices”