linux⽣成20g的⽂件,创建⼀个20G的分区,并格式化为ext4⽂
件系统
创建⼀个 20G 的分区,并格式化为 ext4 ⽂件系统,并完成如下要求:
(1)block ⼤⼩为 2048,预留空间 20%,卷标为 MYDATA
#fdisk /dev/sdb -->n -->p -->1 -->1 -->+20G -->w
#4 -b 2048 -m 20 -L MYDATA /dev/sdb1
(2)挂载⾄/mydata⽬录,要求挂载时禁⽌程序⾃动运⾏,且不更新⽂件的访问时间戳。
#mkdir /mydata
#mount -o noexec,nodiratime -t ext4 -L MYDATA /mydata
#mount |grep sdb1 --> /dev/sdb1 on /mydata type ext4 (rw,noexec,nodiratime)
(3)可开机⾃动挂载。
#vim /etc/fstab
#在最后⼀⾏添加:/dev/sdb1 /mydata ext4 defaults,rw,noexec,nodiratime 0 0
按照格式:要挂载的设备或伪⽂件系统 挂载点 ⽂件系统类型 挂载选项 转储频率 ⾃检次序
附操作步骤:
用ignore造句简单
[root@localhost ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xa4c9dc26.
css实现列表菜单Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
Command action
e extended
p primary partition (1-4)
extracted是什么意思
p
Partition number (1-4): 1
First cylinder (1-5221, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-5221, default 5221): +20G
Command (m for help): wlinux建立文件系统的命令
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# 4 -b 2048 -m 20 -L MYDATA /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=MYDATA
OS type: Linux
Block size=2048 (log=1)
Fragment size=2048 (log=1)
Stride=0 blocks, Stripe width=0 blocks
1312768 inodes, 10490428 blocks
最好的帝国cms模板2098085 blocks (20.00%) reserved for the super usertry except的使用python
First data block=0
Maximum filesystem blocks=548405248
641 block groups
16384 blocks per group, 16384 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
16384, 49152, 81920, 114688, 147456, 409600, 442368, 802816, 1327104, 2048000, 3981312, 5619712, 10240000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@localhost ~]# mkdir /mydata
[root@localhost ~]# mount -o noexec,nodiratime -t ext4 -L MYDATA /mydata [root@localhost ~]# mount |grep sdb1
/dev/sdb1 on /mydata type ext4 (rw,noexec,nodiratime)

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。