Summary of standards for connection
-[] SATA ... Serial ATA. It is installed as standard on most PCs. -[] SAS ... Faster and more reliable than SATA. -[] SCSI: A general project for connecting to peripheral devices. A SCSI host adapter (SCSI card) is required to use a SCSI device.
There is a *** device file *** as an interface for exchanging between devices and PCs. Devices handled by Linux are block devices (those that can access anywhere on the media such as hard disks and SSDs) and character devices (keyboards and devices. There are two types (those that read and write data in character units such as serial ports).
Partition type
You can logically split one disk drive to use different file systems. Below are the BIOS-based partition types.
-[] Basic partition ... You can create up to 4 partitions (/ dev / sda1 to sda4). -[] Extended partition ... This partition stores the logical partition, not the file system. -[] Logical partition: A partition created in an extended partition, which is created from / dev / sda5 regardless of the number of primary partitions.
Partition management command
Syntax: *** fdisk -l {device name (absolute path)} ***
Creating a file system
In the Linux file system, "file contents (data)" and "file attributes and management information" are stored separately. The latter is stored in a management area called an inode (Index node). It is reserved when the file system is created and is assigned one for each file or directory created. Filesystem types include ext2 (Linux standard), ext3 (ext2 with journaling), and Btrfs (high functionality). Btrfs can be run with the *** mkfs.btrfs *** command.
*** mkfs -t File system type You can use {device name} *** to create a file system on a partition.
You can create swap space on the partition with *** mkswap {device name} ***.
The reason why you cannot write to the file system is ・ Insufficient free space ・ Inode depletion Use the *** df *** command to check the free space, and *** df -i *** to check the usage status of the inode. The larger the capacity, the larger the value of the inode allocated. Use the **** du -a *** command to check the space occupied by files and directories.
File system check
The *** fsck -a *** command checks the disk and automatically attempts to repair it. For ext2, ext3 and ext4, the *** e2fsck *** command is available.
File system management
*** tune2fs -i (sec) {device name} *** can be used to specify the check interval.
The file system information is described in the / etc / fstab file. The UUID in the device file field is the ID for identifying the device, and you can check the correspondence between each device and ID with the *** blkid *** command. Masu. Use *** mount [option] *** and *** umount [option] *** as commands.
FHS
Abbreviation for File Hierarchy Standard, which is a file system hierarchy standard.
-[] / bin… Commands that can be used by general users (cat, dd, mount, sh, etc.) are placed. -[] / sbin… Commands required for system administration (fdisc, fsck, reboot, etc.) that can be executed only by the root user are placed. -[] / etc… System and application setting information, script files, etc. are located. -[] / dev… Device files such as hard disk and DVD-ROM are located. -[] / lib… Shared libraries and kernel modules are located. -[] / media… The mount point of removable media is placed. -[] / opt… The directory where the program is installed. -[] / proc… A virtual file system for accessing the inside of the kernel. -[] / boot… The settings and kernel image (file compressed Linux kernel) required for booting are located. -[] / var… There are / cache, / log, run (file showing system status) under / var…. -[] / usr… Commands and utilities are located.
File search
Syntax: *** find {search directory} {search expression} *** Search formula list: -name {file name}… Search by file name. -atime {date and time}… Search by last access time. Syntax: *** which {command name} *** Shows the absolute path where the command is stored. Syntax: *** whereis {option} *** Find where the binary files, source code, and manual files are located. Syntax: *** type {command name} *** Returns whether the specified command is a regular executable, a shell built-in command, or an alias. Result list: Hashed ⇒ External command Shell built-in function ⇒ Built-in command Alias ⇒ Alias It is a reserved word of the shell ⇒ reserved word
Recommended Posts