linux磁碟和檔案系統
fdisk 磁碟裝置 檢視分割槽資訊
fdisk m 檢視操作指令的幫助資訊
p 列表檢視分割槽資訊
n 新建分割槽
d 刪除分割槽
t 變更分割槽型別
w 儲存分割槽設定並退出
q 放棄分割槽設定並退出
---=============================================
(1)fdisk只能建立3個主分割槽和一個擴充套件分割槽.
[root@weblogic dev]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. 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)
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)
Command (m for help): n --->輸入n新建分割槽
Command action
e extended
p primary partition (1-4)
p --->輸入p建立主分割槽
Partition number (1-4): 1 --->輸入分割槽編號1,最多為4個編號
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261): +1000M
Command (m for help): p -->輸入p,列出分割槽
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 123 987966 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e --->輸入e,簡歷擴充套件分割槽
Partition number (1-4): 1 --->其中不能輸入1了,因為已經重複了
Partition 1 is already defined. Delete it before re-adding it.
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e --->輸入e,簡歷擴充套件分割槽
Partition number (1-4): 2
First cylinder (124-261, default 124):
Using default value 124
Last cylinder or +size or +sizeM or +sizeK (124-261, default 261): +600M
Command (m for help): p -->輸入p,列出分割槽
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 123 987966 83 Linux
/dev/sdb2 124 197 594405 5 Extended
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (124-197, default 124):
Using default value 124
Last cylinder or +size or +sizeM or +sizeK (124-197, default 197): +400M
Command (m for help): p
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 123 987966 83 Linux
/dev/sdb2 124 197 594405 5 Extended
/dev/sdb5 124 173 401593+ 83 Linux
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (174-197, default 174):
Using default value 174
Last cylinder or +size or +sizeM or +sizeK (174-197, default 197):
Using default value 197
Command (m for help): p
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 123 987966 83 Linux
/dev/sdb2 124 197 594405 5 Extended
/dev/sdb5 124 173 401593+ 83 Linux
/dev/sdb6 174 197 192748+ 83 Linux
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
p
Partition number (1-4): 3 --->建立最後一個分割槽3
First cylinder (198-261, default 198):
Using default value 198
Last cylinder or +size or +sizeM or +sizeK (198-261, default 261):
Using default value 261
Command (m for help): p -->輸入p,列出分割槽
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 123 987966 83 Linux
/dev/sdb2 124 197 594405 5 Extended
/dev/sdb3 198 261 514080 83 Linux
/dev/sdb5 124 173 401593+ 83 Linux
/dev/sdb6 174 197 192748+ 83 Linux
Command (m for help): w --->w儲存退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
---=====================================================
(3)格式化分割槽
mkfs -t ext3 /dev/sdb1
mkfs.ext3 /dev/sdb5
---=====================================================
(4)為swap增加空間
[root@weblogic ~]# mkswap /dev/sdb5 --->格式化交換分割槽
Setting up swapspace version 1, size = 411226 kB
[root@weblogic ~]# free -m
total used free shared buffers cached
Mem: 1470 393 1076 0 33 272
-/+ buffers/cache: 87 1382
Swap: 2000 0 2000
[root@weblogic ~]# swapon /dev/sdb5 --->啟用交換分割槽
[root@weblogic ~]# free -m
total used free shared buffers cached
Mem: 1470 393 1076 0 33 272
-/+ buffers/cache: 87 1382
Swap: 2392 0 2392
[root@weblogic ~]# swapoff /dev/sdb5 --->停用交換分割槽
[root@weblogic ~]# free -m
total used free shared buffers cached
Mem: 1470 393 1076 0 33 272
-/+ buffers/cache: 87 1382
Swap: 2000 0 2000
---===================================================
(5)掛載,解除安裝檔案系統
mount [-t] 儲存裝置 掛載點目錄
mount -o loop iso映象檔案 掛載點目錄
unmount
mount -t ext3 /dev/sdb1 /disk1
mount /dev/sdb5 /disk2
mount 顯示所有mount的目錄
光碟的掛載:
mount /dev/cdrom /media/cdrom & mount /dev/cdrom /disk4
映象檔案的掛載:
mount -o loop 映象 /disk5
---======================================================
(6)配置檔案系統自動掛載
系統掛載配置檔案主要讀取 /etc/fstab,
倒數第二列,表示是否需要轉儲,0表示不需要。倒數第一列,表示是否要檢測,0表示不需要。
[root@weblogic ~]# more /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/u01 /u01 ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda3 swap swap defaults 0 0
/dev/sdb1 /disk1 ext3 defaults 0 0
/dev/sdb3 /disk2 ext3 defaults 0 0
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-746981/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux磁碟管理與檔案系統(關於磁碟方面)Linux
- Linux Centos系統 磁碟分割槽和檔案系統管理 (深入理解)LinuxCentOS
- Linux 磁碟分割槽及檔案系統管理Linux
- 04 磁碟儲存和檔案系統
- 【Linux基礎入門】Linux磁碟與檔案系統管理命令!Linux
- 磁碟管理與檔案系統
- linux檔案系統和日誌分析Linux
- Linux檔案系統Linux
- [Linux]檔案系統Linux
- Linux系統篇-檔案系統&虛擬檔案系統Linux
- 檔案和檔案系統
- Linux系統檔案系統及檔案基礎篇Linux
- 論Linux檔案系統Linux
- Linux AUFS 檔案系統Linux
- linux的檔案系統Linux
- 檔案系統&&磁碟管理(六)–swap分割槽、迴環裝置、檔案系統配置檔案fstab
- WSL子系統檔案遷移至其他磁碟
- Linux系統磁碟管理Linux
- 『學了就忘』Linux檔案系統管理 — 63、磁碟配額介紹Linux
- 分散式檔案系統(HDFS)與 linux系統檔案系統 對比分散式Linux
- Linux(centos)手動掛載系統磁碟和自動掛載系統磁碟教程LinuxCentOS
- 『學了就忘』Linux檔案系統管理 — 57、Linux檔案系統介紹Linux
- 檔案系統(十一):Linux Squashfs只讀檔案系統介紹Linux
- Linux使用者資訊查詢及磁碟與檔案系統管理命令!Linux
- linux之路(五)檔案系統Linux
- Linux檔案系統、目錄Linux
- Linux 檔案系統詳解Linux
- linux 檔案系統擴容Linux
- Linux檔案系統詳解Linux
- Linux系統的Idea和Webstorm的VMoptions檔案位置LinuxIdeaWebORM
- 『學了就忘』Linux檔案系統管理 — 64、磁碟配額的配置步驟Linux
- Linux系統磁碟和分割槽有哪些命令呢?Linux
- 導覽Linux系統檔案系統型別Linux型別
- Linux系統程式設計【4】——檔案系統Linux程式設計
- 檔案描述符和檔案系統
- Linux系統網路檔案配置Linux
- 12_Linux檔案系統概念Linux
- Linux檔案系統的實現Linux
- Linux EXT2 檔案系統Linux