亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Linux VPS新硬盤分區與掛載教程

系統 1951 0

Linux VPS新硬盤分區與掛載教程

通過此教程對未啟用的硬盤進行分區并掛載,可以確保通過DiyVM面板 重裝系統是不丟失掛載分區的數據!

?

先通過fdisk -l查看目前磁盤分區狀況

?[root@MyVPS ~]#? fdisk -l
Disk /dev/xvda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 13 104391 83 Linux
/dev/xvda2 14 1044 8281507+ 8e Linux LVM

Disk /dev/xvdb:?23.6 GB, 23622320128 bytes
255 heads, 63 sectors/track, 2871 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System

? 我們可以看到/dev/xvdb容量有23.6G,而且沒有分區,接下來我們對它進行分區和掛載
?

# fdisk /dev/xvdb

?[root@MyVPS ~]#? fdisk /dev/xvdb
The number of cylinders for this disk is set to 2871.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

輸入n新建分區
Command (m for help):? n
Command action
e extended
p primary partition (1-4)
p

?

--------------------------------------------------

? 選擇分區類型?
?
??? 這里有兩個選項:?
??? p: 主分區 linux上主分區最多能有4個?
??? e: 擴展分區 linux上擴展分區只能有1個,擴展分區創建后不能直接使用,還要在擴展分區上創建邏輯分區。?
這里我選擇的p。

--------------------------------------------------

/dev/xvdb中第1個分區

--------------------------------------------------

選擇分區個數?

可以選擇4個分區,這里我只分成1個分區?

--------------------------------------------------
Partition number (1-4):? 1
First cylinder (1-2871, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2871, default 2871):
Using default value 2871

輸入W保存退出
Command (m for help):? w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

通過上述步驟我們已將/dev/xvdb分區完成,下面我們對分區格式化并進行掛載

將新分區xvdb1(此名稱因系統而異)格式化為ext3格式
?

# mkfs -t ext3 /dev/xvdb1

[root@MyVPS ~]#? mkfs -t ext3 /dev/xvdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2883584 inodes, 5765319 blocks
288265 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
176 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

將新分區xvdb1掛載,我們示例掛載到/www目錄。 新建目錄/www,然后掛載:

# mkdir /www?? /*建立www目錄*/
# mount /dev/xvdb1 /www??? /*掛載到www目錄*/

完成后我們通過df -hal可以看到,新分區已經掛載到目錄/www上了
?

[root@MyVPS ~]#? df -hal
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5.7G 1.4G 4.1G 25% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
/dev/xvda1 99M 28M 67M 30% /boot
tmpfs 256M 0 256M 0% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
/dev/xvdb1 22G 173M 21G 1% /www

然后編輯/etc/fstab使分區在開機時自動掛載到www

# echo "/dev/xvdb1 /www ext3 defaults 1 2" >> /etc/fstab

Linux VPS新硬盤分區與掛載教程


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲一区二区三区免费观看 | 黄色毛片视频 | 免费人成在线观看69式小视频 | 欧美日韩加勒比一区二区三区 | 久热这里只有精品在线 | 国产骚熟| 青青青爽视频在线观看入口 | 欧美成人免费在线观看 | 国产精品亚洲精品久久成人 | 一级毛片成人免费看免费不卡 | 美国毛片一级e片黑人片 | 91精品国产高清91久久久久久 | 九九九国产在线 | 成 人 黄 片 大全 | 国产三级做爰在线播放最爱 | 中文字幕一区在线观看视频 | 成年人香蕉视频 | 神马九九 | 欧美va亚洲va在线观看蝴蝶网 | 欧美日韩亚洲综合在线一区二区 | 久久精品国产夜色 | 特级毛片aaaa级毛片免费 | 国产成人精品一区二三区在线观看 | 天天色天天操综合网 | 狠狠夜夜 | 久久精品一区二区免费看 | 日本亚洲视频 | 亚洲国产综合精品 | 欧美成人日韩 | 香蕉人人超人人超免费看视频 | 波多野结衣中文一区二区免费 | 久久天天躁狠狠躁夜夜爽 | 99在线热视频只有精品免费 | 美女在线国产 | 欧美成人综合在线 | 精品免费国产一区二区三区 | 奇米影视四色7777 | 色综合天天综合网看在线影院 | 狠狠操天天操夜夜操 | 亚洲日日操 | 国产精品视频ccav |