日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux添加硬盘分区设置柱面,linux 下添加新硬盘设备和硬盘分区格式化挂载使用磁盘配额限制...

發(fā)布時(shí)間:2025/3/21 linux 66 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux添加硬盘分区设置柱面,linux 下添加新硬盘设备和硬盘分区格式化挂载使用磁盘配额限制... 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

磁盤管理

1、查看硬盤設(shè)備信息

fdisk -l

2、磁盤分區(qū)、格式化、掛載使用

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)、對(duì)硬盤分區(qū) 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 創(chuàng)建新分區(qū) [d

是刪除一個(gè)分區(qū)]

4)、 e---創(chuàng)建擴(kuò)展分區(qū)--->l

創(chuàng)建邏輯分區(qū)

p---創(chuàng)建主分區(qū)

填入起始柱面 和

結(jié)束柱面

5)、t設(shè)置文件系統(tǒng)號(hào) 83 --->linux

6)、w

將分區(qū)信息寫入分區(qū)表 【 or q 退出,不寫入】

7)、 格式化為ext3

----->mkfs.ext3 /dev/sdb5

8)、partprobe /dev/sdb

通知所有軟件 有該硬盤設(shè)備

9)、設(shè)置自動(dòng)掛載

vi

/etc/fstab

/dev/sdb5 /mnt ext3 defaults 0

0

10)、掛載fstab文件中沒有掛載的設(shè)備 mount -a

11)、df -h

查看已經(jīng)掛載的所有設(shè)備

磁盤配額限制:

1、 添加一塊新磁盤 ,分區(qū) 、格式化 、(mkfs.etx3

/dev/sdc5/)

2、設(shè)置開機(jī)自動(dòng)掛載(vi /etc/fstab)

添加磁盤配額支持 (用戶配額usrquota、組配額grpquota)

/dev/sdc5

/mnt ext3 defaults,usrquota,grpquota 0 0

3、mount -a /dev/sdc5 掛載磁盤

4、在掛載點(diǎn)下面生成配額數(shù)據(jù)庫(kù)

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

這里是之整個(gè)組只能用限額之內(nèi)的還是組內(nèi)每個(gè)人都能用那么多?

6、開啟磁盤配額限制 quotaon -aug

7、測(cè)試 dd if=/dev/zero of=test.txt bs=10M

count=2

《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的linux添加硬盘分区设置柱面,linux 下添加新硬盘设备和硬盘分区格式化挂载使用磁盘配额限制...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。