Linux 基础练习
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux 基础练习相关的知识,希望对你有一定的参考价值。
1、创建一个10G分区,并格式化为ext4的文件系统
[[email protected] ~]# 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 0xda03c3cc. 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) p Partition number (1-4): 1 First cylinder (1-2610, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +10G Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [[email protected] ~]# partx -a call: partx -opts [device] wholedisk [[email protected] ~]# partx -a /dev/sdb BLKPG: Device or resource busy error adding partition 1 [[email protected] ~]# partx -a /dev/sdb BLKPG: Device or resource busy error adding partition 1 [[email protected] ~]# cat /proc/partitions[[email protected] ~]# cat /proc/partitions[[email protected] ~]# cat /proc/partitions[[email protected] ~]# cat /proc/partitions[[email protected] ~]# cat /proc/partitions[[email protected] ~]# cat /proc/partitions[[email protected] ~]# cat /proc/partitions major [[email protected] ~]# cat /proc/partitionsminor #[[email protected] ~]# cat /proc/partitionsblocks [[email protected] ~]# cat /proc/partitionsname 8 0 104857600 sda 8 1 512000 sda1 8 2 104344576 sda2 8 16 20971520 sdb 8 17 10490413 sdb1 253 0 52428800 dm-0 253 1 2031616 dm-1 253 2 49881088 dm-2
本文出自 “自动化学习之路” 博客,谢绝转载!
以上是关于Linux 基础练习的主要内容,如果未能解决你的问题,请参考以下文章