新聞中心
由于linux操作系統(tǒng)的安全性、可靠性以及靈活的部署方式,目前已經(jīng)在數(shù)據(jù)中心和公司的服務(wù)器等商用計算設(shè)備中得到了廣泛的應(yīng)用。然而,隨著系統(tǒng)數(shù)據(jù)量的不斷增長,有時候需要擴展存儲空間來滿足業(yè)務(wù)需求。Linux操作系統(tǒng)具有豐富的存儲空間擴展機制,以滿足任何類型的硬件設(shè)備及其應(yīng)用程序的存儲需求。本文將介紹Linux操作系統(tǒng)怎么擴展存儲空間。

首先,如果需要擴展Linux系統(tǒng)的存儲空間,需要得到物理設(shè)備,如新的硬盤或服務(wù)器系統(tǒng)本身內(nèi)置的存儲設(shè)備。在添加設(shè)備到Linux系統(tǒng)之前,需要使用fdisk命令將設(shè)備分區(qū),可以創(chuàng)建一個到多個分區(qū)或者虛擬卷組來擴展系統(tǒng)空間。下面是使用fdisk命令會話的一個實例:
[root@host ~]# fdisk /dev/sdb
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-xxx, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-xxx, default xxx):
Using default value xxx
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
接下來需要創(chuàng)建物理卷組(PV)來管理磁盤空間,使用下面的具體步驟:
? 掃描物理卷:使用以下命令掃描/dev/sdb1設(shè)備
[root@host ~]# vgscan
Reading volume group metadata from all physical volumes.
Found volume group "VolGroup" using metadata type lvm2
? 激活物理卷組:使用以下命令激活/dev/sdb1
[root@host ~]# vgchange -ay
4 logical volume(s) in volume group "VolGroup" now active
? 創(chuàng)建邏輯卷:使用以下命令創(chuàng)建50GB大小的邏輯卷
[root@host ~]# lvcreate -L 50G VolGroup -n lv_new_data
Logical volume "lv_new_data" created.
? 格式化新建邏輯卷:使用以下命令格式化新建邏輯卷
[root@host ~]# mkfs.ext4 /dev/VolGroup/lv_new_data
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6773760 inodes, 26948608 blocks
1347430 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
4096 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
? 掛載新建邏輯卷:使用以下命令掛載新建邏輯卷
[root@host ~]# mount /dev/VolGroup/lv_new_data /mnt/
以上步驟就是如何在Linux上擴展存儲空間的具體過程。此外,可以使用動態(tài)擴展(LVM)來動態(tài)管理存儲空間,而不用每次都添加設(shè)備就可以擴展。雖然它降低了部署和管理的復(fù)雜度,但只能在特定的硬件環(huán)境下才能使用。
因此,可以通過以上提到的步驟在Linux操作系統(tǒng)中擴展存儲空間,滿足用戶對數(shù)據(jù)存儲的需求。這將對具有存儲需求的系統(tǒng)管理員來說是一個很好的解決方案,以滿足任何類型設(shè)備和應(yīng)用程序需求的存儲空間。
香港服務(wù)器選創(chuàng)新互聯(lián),2H2G首月10元開通。
創(chuàng)新互聯(lián)(www.cdcxhl.com)互聯(lián)網(wǎng)服務(wù)提供商,擁有超過10年的服務(wù)器租用、服務(wù)器托管、云服務(wù)器、虛擬主機、網(wǎng)站系統(tǒng)開發(fā)經(jīng)驗。專業(yè)提供云主機、虛擬主機、域名注冊、VPS主機、云服務(wù)器、香港云服務(wù)器、免備案服務(wù)器等。
當(dāng)前名稱:Linux如何擴展存儲空間(linux擴展目錄空間)
網(wǎng)頁網(wǎng)址:http://m.fisionsoft.com.cn/article/dhseggi.html


咨詢
建站咨詢
