linux磁盘管理
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了linux磁盘管理,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2579字,纯文字阅读大概需要4分钟。
内容图文
![linux磁盘管理](/upload/InfoBanner/zyjiaocheng/1059/e7ae7e49b2f943859f7470f0f701c95b.jpg)
# 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
本文出自 “何全” 博客,请务必保留此出处http://hequan.blog.51cto.com/5701886/1759336
原文:http://hequan.blog.51cto.com/5701886/1759336
内容总结
以上是互联网集市为您收集整理的linux磁盘管理全部内容,希望文章能够帮你解决linux磁盘管理所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。