Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux formatted data disk

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Environment file system: ext4 partition type: MBROS:CentOS7 create partition [root@CentOS7 ~] # echo-e "n\ nw" | fdisk / dev/sdbWelcome 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 tableBuilding a new DOS disklabel with disk identifier 0xb2302c66.Command (m for help): Partition type: P primary (0 primary, 0 extended) 4 free) e extendedSelect (default p): Using default response pPartition number (1-4, default 1): First sector (2048-41943039, default 2048): Using default value 2048Last sector, + sectors or + size {K default G} (2048-41943039, default 41943039): Using default value 41943039Partition 1 of type Linux and of size 20 GiB is setCommand (m for help): The partition table has been altered calling ioctl () to re-read partition table.Syncing disks. [root@CentOS7 ~] # fdisk-l / dev/sdbDisk / dev/sdb: 21.5GB, 21474836480 bytes 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0xb2302c66 Device Boot Start End Blocks Id System/dev/sdb1 2048 41943039 20970496 83 Linuxps: only / dev/sdb disk is divided into a single partition All the space is given to it to create the file system [root@CentOS7] # mkfs.ext4 / dev/sdb1mke2fs 1.42.9 (28-Dec-2013) Filesystem label=OS type: LinuxBlock size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks1310720 inodes, 5242624 blocks262131 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=2153775104160 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768,98304,163840,229376,294912,819200,884736,1605632,2654208 4096000Allocating group tables: doneWriting inode tables: done Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: donemount mount [root@CentOS7 ~] # mkdir / mnt/sdb1 Mount / dev/sdb1 / mnt/sdb1 [root@CentOS7 ~] # findmnt / mnt/sdb1 TARGET SOURCE FSTYPE OPTIONS/mnt/sdb1 / dev/sdb1 ext4 rw,relatime Data=ordered permanent mount [root@CentOS7 ~] # echo-e "/ dev/sdb1\ t/mnt/sdb1\ text4\ tdefaults\ t0\ t0" > / etc/fstab [root@CentOS7 ~] # sed-n'$p' / etc/fstab / dev/sdb1 / mnt/sdb1 ext4 defaults 0 0/etc/fstab explains that each line defines a file system to be mounted. First column: device to be mounted or pseudo file system device file LABEL:LABEL= "" UUID:UUID= "" pseudo file system name: proc Sysfs second column: Mount point third column: file system type: ext4 Xfs,iso9660,nfs,none fourth column: mounting options: defaults, acl,bind fifth column: dump frequency 0: no backup 1: daily dump 2: dump column 6: order of file systems checked by fsck every other day, the allowed number is 0 120: no self test 1: first self test Generally only rootfs uses 2: non-rootfs use common disk management commands to synchronize the partition table to see if the kernel has recognized the new partition cat / proc/partitions informs the kernel to reread the hard disk partition table CentOS6:partx / dev/DEVICE CentOS5,7:partprobe / dev/DEVICE create a file system mkfs command: 1) mkfs.FS_TYPE / dev/DEVICE 2) mkfs-t FS_TYPE / dev/DEVICE file system label blkid: check Find / print block device attribute Usage: blkid-L |-U findfs: find the file system by label or UUID Usage: findfs [options] {LABEL UUID,PARTUUID,PARTLABEL} =

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report