# free -m
# fdisk -l
parted 大于2T的分区工具
parted /dev/sdb mkpart primary ext3 0 2T
人品 能力
忠诚 敬业 自动自发 负责 注重效率 结果导向 善于沟通 合作 积极进取 低调 节约 感恩
主分 区 扩展分区 逻辑分区
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
n
Command action
e extended
p primary partition (1-4)
1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130): +500M
Device Boot Start End Blocks Id System
/dev/sdb1 1 20 160618+ 83 Linux
/dev/sdb2 21 130 883575 5 Extended
# partprobe /dev/sdb 通知系统内核 分区改变了
t L
/dev/sdb1 1 20 160618+ 8e Linux LVM
/dev/sdb1 1 20 160618+ 8e Linux LVM
This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# tune2fs -c -1 /dev/sdb1
tune2fs 1.41.12 (17-May-2010)
Setting maximal mount count to -1
# mount /dev/sdb1 /mnt
w 保存
parted GNU磁盘分区工具,,大于2T
# parted /dev/sdb
GNU Parted 2.1
使用 /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of
commands.
(parted) rm
分区编号? 1
1(parted) mklabel gpt
警告: The existing disk label on /dev/sdb will be
destroyed and all data on this disk will be lost. Do you
want to continue?
是/Yes/否/No? yes
(parted) p
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
(parted) mkpart primary 0 500
警告: The resulting partition is not properly aligned for
best performance.
忽略/Ignore/放弃/Cancel? Ignore
Number Start End Size File system Name 标志
1 17.4kB 500MB 500MB primary
(parted) mkpart logical 501 1024
2 501MB 1024MB 523MB logical
# mkfs.ext4 /dev/sdb1
# df -hT
parted /dev/sdb mklabel gpt
parted /dev/sdb mkpart primary 0 500
parted /dev/sdb mkpart logical 501 1024
parted /dev/sdb p
mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /tmp/
mount -t 文件系统类型 -o 挂载的选项 -a
umount -lf 强制卸载
dd 转换文件 - convert and copy a file
dd if=/dev/sda of=mbr.bin bs=512 count=1
mkfs.ext4
df -h
du -sh 查看文件及目录大小
# du -sh /etc/* h人类可读
# du -sh /etc
27M /etc
tune2fs - adjust tunable filesystem parameters on
ext2/ext3/ext4 filesystems
dumpe2fs - dump ext2/ext3/ext4 filesystem infor-
mation