linux添加硬盘分区设置柱面,linux 下添加新硬盘设备和硬盘分区格式化挂载使用磁盘配额限制...
磁盤管理
1、查看硬盤設備信息
fdisk -l
2、磁盤分區、格式化、掛載使用
1)、查看硬盤信息:fdisk -l
[root@localhost ~]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480
bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of
16065 * 512 = 8225280 bytes
Device Boot Start
End Blocks Id System
/dev/sda1 * 1 6
48163+ 83 Linux
/dev/sda2 7 515
4088542+ 83 Linux
/dev/sda3
516 2480 15783862+ 83 Linux
/dev/sda4 2481 2610
1044225 5 Extended
/dev/sda5 2481 2610
1044193+ 82 Linux swap / Solaris
Disk /dev/sdb: 21.4 GB, 21474836480
bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of
16065 * 512 = 8225280 bytes
Device Boot Start
End Blocks Id System
/dev/sdb1
1 2610 20964793+ 5 Extended
/dev/sdb5
1 2610 20964762 83 Linux
Warning: invalid flag 0x0000 of
partition table 5 will be corrected by w(rite)
Disk /dev/sdc: 42.9 GB,
42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units =
cylinders of 16065 * 512 = 8225280 bytes
Device
Boot Start End Blocks
Id System
/dev/sdc1 11 5221 41857357+
5 Extended
/dev/sdc4 1 10
80293+ 83 Linux
2)、對硬盤分區 fdisk /dev/sdb
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk
/dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for
the first PS/2 ESDI drive)
Command
action
l list known partition types
n add a new partition
p print
the partition table
q quit without saving changes
t change a partition's system id
u change
display/entry units
w write table to disk and
exit
3)、n 創建新分區 [d
是刪除一個分區]
4)、 e---創建擴展分區--->l
創建邏輯分區
p---創建主分區
填入起始柱面 和
結束柱面
5)、t設置文件系統號 83 --->linux
6)、w
將分區信息寫入分區表 【 or q 退出,不寫入】
7)、 格式化為ext3
----->mkfs.ext3 /dev/sdb5
8)、partprobe /dev/sdb
通知所有軟件 有該硬盤設備
9)、設置自動掛載
vi
/etc/fstab
/dev/sdb5 /mnt ext3 defaults 0
0
10)、掛載fstab文件中沒有掛載的設備 mount -a
11)、df -h
查看已經掛載的所有設備
磁盤配額限制:
1、 添加一塊新磁盤 ,分區 、格式化 、(mkfs.etx3
/dev/sdc5/)
2、設置開機自動掛載(vi /etc/fstab)
添加磁盤配額支持 (用戶配額usrquota、組配額grpquota)
/dev/sdc5
/mnt ext3 defaults,usrquota,grpquota 0 0
3、mount -a /dev/sdc5 掛載磁盤
4、在掛載點下面生成配額數據庫
quotacheck -cumg /mnt
[root@localhost
mnt]# ll
total 16
-rw------- 1 root root 6144 Jun 16 05:21
aquota.group
-rw------- 1 root root 6144 Jun 16 05:21
aquota.user
5、編輯用戶配額和組配額 edquota -u user1 or edquota -g web
這里是之整個組只能用限額之內的還是組內每個人都能用那么多?
6、開啟磁盤配額限制 quotaon -aug
7、測試 dd if=/dev/zero of=test.txt bs=10M
count=2
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的linux添加硬盘分区设置柱面,linux 下添加新硬盘设备和硬盘分区格式化挂载使用磁盘配额限制...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux关闭涉及安全的服务,Linux
- 下一篇: linux 删除20日前数据,Linux