[Badblocks]
Badblocks disk Bad Check tool, can actually use mke2fs-c <dev> to replace this command
-S shows progress on the screen
-V can see the text message progress on the screen
-W is tested in write mode. (This parameter is not recommended when you see a file)
[Blockid]
Blkid <dev>
To view the properties of a partition
[Dump]
Dump-f <*.*> <filename> will <filename> back up to <*.*>, and the second backup is only the difference portion of the first backup.
-S do not write-f option to view backup <filename> how much space is required
-W to see if any files have been backed up here
-U logs the dump time to/etc/dumpdates
-V Textual Representation process
-j compressed into bzip2
-[0,9] Set Compression ratio
Related commands Restore
[DUMPE2FS]
DUMPE2FS <dev>
Displays the details of the partition.
-H
Displays only the information in the Super block.
[E2fsck]
E2fsck <dev>
Check and repair ext file system
-F
Force check
-P
Automatic repair
[E2lable]
E2lable <dev>
Viewing a partitioned volume label
E2label <dev> <label.name>//Add disk name to disk
[Fsck]
Fsck <dev>
Check and repair the Linux file system
-T <fs.type>
Classification of file systems
-A
Automatic repair
-Y and-A are the same, but some systems only support this parameter
Use histogram to show progress during-c inspection
There are some specific parameters in the file system for EXT2/3
-F Mandatory Check
-D optimized configuration for file system directories
Files recovered during inspection will be placed in the lost+found of the partition
[Hdparm]
Hdparm <dev> commands for viewing performance or settings on the IDE
-T test hard drive actual access performance available for SATA drives
[Lvcreate]
Lvcreate-n <lv.name> L <size> g <vg.name>//Specify the name, size, and settings on which volume group to create. The LV reference path is/dev/<vg.name>/<lv.name>
-S <lv.path>//Create snapshot volume, still specify size with L
-p {r|w}//Set permissions, snapshot volume should be set to read-only volume
Associated commands: LV-led commands are related to logical volumes. See the PV command for specific comments.
[Lvextend]
Lvextend//Extended Logical Volume
-l {+<num>g|<num>g} <lv.path>//extensions | extended to <num>g
[Lvreduce]
Lvreduce
-l {-<num>|<num>} <lv.path>//reduction of logical sub-volumes may result in data loss.
[Lvremove]
Lvremove <lv.name>//Removing a logical volume
[LVS]
LVS//View LV
[Mdadm]
Mdadm is a RAID-related command
Mode:
-a assembly mode//Transfer RAID re-assembly, etc.
-C <options> </dev/sd#> Create mode//create RAID device The following options are available in-C mode
-L <num>//Set creation level
-N <num>//Set number
-a {Yes|no}//Automatically create a device file for it
-c//Specifies the size of the block or can be written as--chunk
-X <num>//Specify the number of free disks.
-F Monitor Mode//check if RAID is normal
-G growth mode//expand Raid
-D </dev/md#>//displays details of a RAID device, or can be written as--detail
--scan//And-D are displayed with simple information such as UUID. The content is redirected to/etc/mdadm.conf. Can be read automatically at a later time.
The specific commands are management mode. Mdadm to indicate which drive it is. such as: Mdadm <md#>-A <sda#>
-A </dev/sda#>//Add a hard drive. Can also be written as--add
-F </dev/sda#>//simulation of a disk in a RAID error. Can also be written as--fail or--set-faulty.
-R </dev/sda#>//Remove a state. Can also be written as--remove
-S <md#>//Stop an array. Can also be written as--stop
Configuration file/proc/mdstat View the status of the raid file
The created md# needs to be formatted and mounted for use.
[MKFS]
MKFS <dev>
Create a file system. That is, advanced formatting.
-T <fs.type>
Specifies the type of file system.
There is a VFS in Linux that allows commands from different file systems to be uniformly output to the same command.
Related Commands mkfs.x
[Mkfs.x]
Mkfs.ext2 <dev> Create ext2 file system
There are more mkfs.x commands.
Related Commands Mkfs
[MKE2FS]
MKE2FS <dev>
Creating a Ext2 File system
-j
Creating a Ext3 File system
-B {1024|2048|4096}
Specify block size
-L
Set the volume label name
M <num>
Specify the percentage reserved for super users
-I <num>
Specifies the inode size, which defaults to 8192. <num>∈2^n
-F
Forcing the file system to be created
-E
User specified additional file system attributes (n/a)
[Mkswap]
Mkswap <dev>
Create swap partition
-l <lable> Specify volume label.
[Pvcreate]
Pvcreate <dev/sd#>
Build a physical volume
-F
Force creation
Associated commands: Note that the commands for PV lead in this text are related to physical volumes.
The LV (logical volume) must be built on the VG (volume group), and the VG must be built on the PV (physical volume).
[Pvdisplay]
Pvdisplay//View Physical volume details
[Pvmove]
Pvmove <sda#>//Transfer data from physical volumes to other PV up
[Pvremove]
Pvremove <sda#>//Deleting a physical volume
[PVs]
PVS//View physical volumes
[Pvscan]
Pvscan//Scan a physical volume on your computer
[Restore]
Restore-f <dumpfile> Recover dump files
-T view the backup file for important data
-C View whether the backup and actual files are different, and output different files
-I This is an interactive command that can restore some files
-R Restore the entire file system
-H View information such as Inode,label in a full backup
-D and-C can be used to detect the subsequent mount points and the different files within the dump
Related commands Dump
[TUNE2FS]
TUNN2FS <dev> Lossless Change partition file system
-j
Non-destructive to the ext2 to ext3.
Be careful not to downgrade
-L <string>
Set or modify the volume label.
-M
Adjust the reservation percentage.
-R
Adjust the number of reserved blocks.
-C <num>
Set disk mount n Thereafter, the self-test begins. 0 OR-1 is the off function.
-I <num>
Set the disk to use N days before starting the self-test. 0 OR-1 is the off function.
-L
Displays the information in the Super block.
[Swapon]
Swapon <dev>
Enable swap partition
-A
Enable all partitions specified in the/etc/fstab
[Swapoff]
Swapoff <dev>
Close Swap partition
[Vgcreate]
Vgcreate <vg.name> <pv.sda#>
Create a volume group with a name that resembles a logical partition consisting of multiple physical disks
-S <num>
Specify PE size, do not write default to 4M
Associated Command: VG (volume group) The lead command is related to the volume group. See the notes for PV in detail.
[Vgdisplay]
Vgdisplay <vg.name>//View the VG details
[Vgextend]
Vgextend <vg.name> <sda#>//Extended Volume group
[Vgreduce]
Vgreduce <vg.name> <pv.sda#>
Removes a physical volume from the volume group. (Use Pvmove to transfer data on a physical volume)
[Vgremove]
Vgremove <vg.name>//Remove a volume group
[VGS]
VGS//View Volume group
L-1-19 Linux raid& partition & File system commands