linux 利用另一塊硬盤擴展指定目錄的大小:
1.加入一塊新硬盤
2.建立分區(qū):
2.1 查看硬盤信息 fdisk -l
2.2 開始分區(qū) fdisk /dev/sdb
command action (m for help) : n
--(建立分區(qū):
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition //刪除一個分區(qū)
l list known partition types //列出分區(qū)類型
m print this menu //列出幫助信息
n add a new partition //添加一個分區(qū)
o create a new empty DOS partition table
p print the partition table //列出分區(qū)表
q quit without saving changes //不保存退出
s create a new empty Sun disklabel
t change a partition's system id //改變分區(qū)類型
u change display/entry units
v verify the partition table
w write table to disk and exit //把分區(qū)表寫入硬盤并退出
x extra functionality (experts only) //擴展功能
)
e extended
p primary partition
# p
partition number (1-4):2 #創(chuàng)建第二個主分區(qū)
first cylinder (11-522,default 11):11
last cylinder ...(11-522,default 522): +100M #自定義分區(qū)大小
2.2 格式化
#mkfs -t ext3 -c /dev/sdb1
.....
100%后
2.3 掛載到/www
mount /dev/sdb1 /www
注意:mount 后原來/www目錄下的,但是后掛載的會把前面的覆蓋(前一分區(qū)的數(shù)據(jù)還在,只是從目錄上就只能看見后一分區(qū)的數(shù)據(jù))
兩個分區(qū)“疊加”到同一個目錄的話要用aufs來掛載。
本文出自:億恩科技【prubsntakaful.com】
服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]
|