一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

Linux|Centos|Ubuntu|系統進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務器之家 - 服務器系統 - Linux - 詳解linux添加硬盤分區掛載教程

詳解linux添加硬盤分區掛載教程

2022-03-07 16:44渣渣輝 Linux

本篇文章主要介紹了詳解linux添加硬盤分區掛載教程,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

基本步驟:分區——格式化——掛載——寫入文件

1、首先用fdisk -l命令查看添加的硬盤名稱,可以看到sdb為新增的硬盤

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[root@oracle ~]# fdisk -l
 
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
 
255 heads, 63 sectors/track, 2610 cylinders
 
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
Disk identifier: 0x00000000
 
Disk /dev/sda: 21.5 GB, 21474836480 bytes
 
255 heads, 63 sectors/track, 2610 cylinders
 
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
Disk identifier: 0x0006b59c
 
Device Boot   Start     End   Blocks  Id System
 
/dev/sda1  *      1     39   307200  83 Linux
 
Partition 1 does not end on cylinder boundary.
 
/dev/sda2       39    2358  18631680  83 Linux
 
/dev/sda3      2358    2611   2031616  82 Linux swap / Solaris

2、進行分區,輸入m查看提示

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[root@oracle ~]# 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 0x09f38795.
 
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): m
 
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)

分析:主要參數的解析

1. 輸入 m 顯示所有命令列示。

2. 輸入 p 顯示硬盤分割情形,打印分區表。

3. 輸入 a 設定硬盤啟動區。

4. 輸入 n 創建新的硬盤分割區。

  4.1. 輸入 e 硬盤為[延伸]分割區(extend)。

  4.2. 輸入 p 硬盤為[主要]分割區(primary)。

5. 輸入 t 改變硬盤分割區屬性?!         ?/p>

  1. t:分區系統id號
  2. L:82:linux swap
  3. 83:linux
  4. 86:NTFS window分區

6. 輸入 d 刪除硬盤分割區屬性。

7. 輸入 q 結束不存入硬盤分割區屬性。

8. 輸入 w 結束并寫入硬盤分割區屬性

3、輸入n創建新的硬盤分區——輸入p創建主分區——輸入1設置一個分區——回車——回車(默認全部空間)

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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):
 
Using default value 2610

4、輸入p查看分區情況——輸入w保存退出(一定要w保存不然無效)

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Command (m for help): p
 
 
 
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
 
255 heads, 63 sectors/track, 2610 cylinders
 
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Sector size (logical/physical): 512 bytes / 512 bytes
 
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
Disk identifier: 0x09f38795
 
 
 
  Device Boot   Start     End   Blocks  Id System
 
/dev/sdb1        1    2610  20964793+ 83 Linux
 
 
 
Command (m for help): w
 
The partition table has been altered!
 
 
 
Calling ioctl() to re-read partition table.
 
Syncing disks.

5、mkfs命令格式化磁盤

?
1
2
3
[root@oracle ~]# mkfs.ext4 /dev/sdb
 
mkfs.ext4: invalid fragment size - /dev/sdb

6、mount命令掛載分區

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@oracle ~]# mount /dev/sdb /oracle/
 
You have new mail in /var/spool/mail/root
 
[root@oracle ~]# df -TH
 
Filesystem   Type  Size Used Avail Use% Mounted on
 
/dev/sda2   ext4  19G  11G 7.3G 60% /
 
tmpfs     tmpfs 2.1G  74k 2.1G  1% /dev/shm
 
/dev/sda1   ext4  297M  29M 253M 11% /boot
 
/dev/sdb    ext4  22G  47M  20G  1% /oracle

7、添加到/etc/fstab文件下保存退出否則重啟后硬盤消失

?
1
/dev/sdb    /oracle     ext4  defaults,noatime    0 0

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。

原文鏈接:http://www.cnblogs.com/Dev0ps/p/8807939.html

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: yy6080午夜国产免费福利 | 嫩草视频在线观看视频播放 | 欧美区在线 | 韩国日本香港毛片免费 | 国产欧美久久久精品影院 | 国产免费午夜 | 91传媒制片厂制作传媒破解版 | 美女福利视频午夜在线 | 视频一区二区三区在线 | 国产午夜精品久久久久 | 青草视频免费观看 | 国产高清一区二区三区免费视频 | 亚洲国产精品久久久久久 | 热99精品只有里视频最新 | 日韩国产成人 | 日韩高清一区二区 | 国产精品免费观在线 | 日韩欧美成末人一区二区三区 | 国产日韩高清一区二区三区 | 青青在线视频免费 | 亚洲aⅴ天堂 | 楚乔传第二部全60集免费观看 | 国产91素人搭讪系列天堂 | 24adc年龄18岁欢迎大驾光临 | 免费观看无遮挡www的小视频 | 久久久久伊人 | h黑寡妇一级毛片 | 91桃色视频 | 午夜在线观看免费完整直播网页 | 99成人免费视频 | 日本aa大片在线播放免费看 | 四虎永久成人免费 | 国产精品亚洲午夜不卡 | 双夫1v2| 成人永久免费福利视频网站 | 天堂8在线天堂资源在线 | 午夜AV国产欧美亚洲高清在线 | 花唇肿胀无法合拢双性 | 国产精品久久久久一区二区三区 | 国产区综合另类亚洲欧美 | 国产日韩欧美综合在线 |