Posts

15 managing disks - mounting created file system blkid mount/umount mount LABEL=myfs /mnt

[root@svn ~]# mount /dev/sdb1 /mnt mounting means connecting some specific device or functionality to directory [root@svn ~]# mount sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=905484k,nr_inodes=226371,mode=755) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) cgroup on /sys/fs/cgr...

15 managing disk - creating filesystem mkfs

[root@svn ~]# cat /proc/partitions  major minor  #blocks  name    8        0   31457280 sda    8        1    1048576 sda1    8        2   19921920 sda2    8       16    5242880 sdb    8       17     102400 sdb1   11        0    8086528 sr0  253        0   17821696 dm-0  253        1    2097152 dm-1 at this point partition created sdb1 is empty, meaning we cannot do anything with it. to do something with it, we need to create FS on it. [root@svn ~]# mkfs mkfs         mkfs.cramfs  mkfs.ext3    mkfs.fat     mkfs.msdos   mkfs.xfs mkfs.btrfs   mkfs.ext2    mkfs.ext4    mkfs.minix   mkfs.vfat ...

15 managing disks - file system difference

Understanding different filesystems At the time of writing this, there are over 60 different filesystems available for Linux. The following is a brief overview of the common ones you may frequently encounter: - Btrfs: B-tree filesystem is a copy-on-write filesystem developed by Oracle in 2007. It is still in the developmental stage and considered experimental. The intention of Btrfs is to allow the filesystem to scale as drives get larger and larger. Because of its benefits, it is being considered as the filesystem to replace ext4. - ext2: It was introduced in 1993. This filesystem does not have journaling and hence, has fewer writes per cycle, making it a good choice for flash drives. ext3: It is very similar to ext2 with the addition of journaling, which improves reliability , especially after an unclean shutdown. - ext4: Being released in 2008, it is considered the successor of ext3. It can handle volumes up to 1 exbibyte and files up to 16 teb...

15 managing disks - creating partitions fdisk /proc/partitions /dev/sda

Image
[svn@svn ~]$ cat /proc/partitions major minor  #blocks  name    8        0   31457280 sda    8        1    1048576 sda1    8        2   19921920 sda2    8       16     5242880 sdb   11        0    8086528 sr0  253        0   17821696 dm-0  253        1    2097152 dm-1 [svn@svn ~]$ sdb - new disk, there are no partitions on this disk [root@svn ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0xf12de6be. Command (m for help):  Command (m for help): m Command action...

15 managing disk partitions Logical Volume, Physical Volume and Volume Groups

Image
partition is a fixed amount of disk space with LVM it's easy to grow logical volume later Logical volume management is a widely-used technique for deploying logical rather than physical storage. With LVM, "logical" partitions can span across physical hard drives and can be resized (unlike traditional ext3 "raw" partitions). A physical disk is divided into one or more physical volume s (Pvs), and logical volume groups (VGs) are created by combining PVs . You should read some more specified info here at The Linux Logical Volume Manager This picture pretty much sums it up Also there's some good information at  A Beginner's Guide To LVM One of the big advantages of LVM is that you can most easily reduce the size of one partition, and use it on other partitions for example, without data loss . You can also allocate minimal amounts of space for each logical volume and leave some of the disk unallocated . Then, when the partitions s...

pgrep -f [part of a command] pkill -f [part of a command]

pgrep -f [part of a command] pkill -f [part of a command]

rsyslog for apache

RSyslog Forwarding Setup Overview I'm looking to centralize logging for our dev team into Elasticsearch via Logstash. The wrinkle is that we aren't a Java shop, so installing java on our hosts just to ship logs back to a central Logstash indexer is something we'd like to avoid. So, I'm approaching things as a chance to understand RSyslog and its capabilities as a log shipper. Procedure Set up TCP listening on the log index host Uncomment the following lines in  /etc/rsyslog.conf . This will enable the rsyslog daemon to listen for incoming requests on TCP port 514. We're using TCP here so that we can have some confidence that the messages from the agent hosts reach the indexer. (More on this below) # Provides TCP syslog reception $ModLoad imtcp $InputTCPServerRun 514 Add a line to  /etc/rsyslog.conf  to actually put the received logs in a specific file. local3.* /local/logs/httpd-error local4.* /local/logs...