Disk partition, make file system, boot and autofs service

disk:
view disk:
df -h show disk status
df -Th show disk status and type
fdisk -l show entire disk size and existing partitions

Partition, make file system (format)
fdisk /dev/[unused disk space]
p display disk information
l: logical partition
e: extended partition
p: primary partition
n create new partition
w save new partition
d delete partition

partprobe update partition Table (In versions after RHEL6.0, this command does not work and needs to be restarted)
mkfs.ext3 [new partition name] Specify the new partition type and format
mount Temporarily mount it at
boot:
vim /etc/fstab Modify this file to create a new partition permanent mount
mount device mount point file system type file system attribute [0\1\2] [0\1\2]: whether to check the file system

/etc/rc.local The last script read by the system startup
/etc/mtab is the file read by the mount command


Mount and unmount
umount [device mount point to unmount] unmount partition
mount -o loop mount image file
mount -t [file system type] [mount device] [mount point] The default file system type is ext3
cifs samba -o Specify the attributes of the file
system (default is default)
-o ro mount read-only
-o usrquota make disk quotas for users
-o grpquota make disk quotas for groups
Parameters are separated by commas when used in parallel

 

blkid [device name] View the UUID of this device
/dev/sdb1: UUID="c8058b3e-49fe-4f2b-905f-aa5646e5bcb5" SEC_TYPE="ext2" TYPE="ext3"

e2label [device name] [new volume label name] Modify the device volume label name
findfs LABEL=[volume label name] View the device according to the volume label name

 

autofs service: auto mount service
vim /etc/auto.master main configuration file
path and name of the parent directory of the mount point auxiliary configuration file
Create a parent directory of the mount point: create a new directory as the parent directory of the mount point
Create an auxiliary configuration file: [mount point] -fstype=auto (unrecognized file systems need to be specified, such as NFS, iso9660, loop): [name of the device to be mounted]
Restart the autofs service: /etc/init. d/autofs restart

 


Main file: /mnt/9660 /etc/9660.auto
Secondary configuration file: ys -fstype=iso9660,loop:/root/Desktop/rhel5.iso

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324611067&siteId=291194637