欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

Linux系統(tǒng)下怎么對硬盤分區(qū)進(jìn)行擴(kuò)容-創(chuàng)新互聯(lián)

這篇文章主要講解了“Linux系統(tǒng)下怎么對硬盤分區(qū)進(jìn)行擴(kuò)容”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“Linux系統(tǒng)下怎么對硬盤分區(qū)進(jìn)行擴(kuò)容”吧!

為咸豐等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及咸豐網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都做網(wǎng)站、網(wǎng)站建設(shè)、外貿(mào)營銷網(wǎng)站建設(shè)、咸豐網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!

硬盤快滿了,加硬盤擴(kuò)容,不管是獨(dú)立的服務(wù)器,還是云空間新買的硬盤,擴(kuò)容方式一樣。

一,不采用lvm,直接將硬盤掛載到目錄
1,查看硬盤分區(qū)情況



代碼如下:


[root@iZ94zz3wqciZ ~]# df  
Filesystem     1K-blocks     Used Available Use% Mounted on  
/dev/xvda1      20641404 14778400   4814480  76% /  
tmpfs             509300        0    509300   0% /dev/shm  
 
[root@iZ94zz3wqciZ ~]# fdisk -l  
 
Disk /dev/xvda: 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: 0x00078f9c  
 
   Device Boot      Start         End      Blocks   Id  System  
/dev/xvda1   *           1        2611    20970496   83  Linux     //id是83,非lvm  
 
Disk /dev/xvdb: 23.6 GB, 23622320128 bytes         //新買的硬盤  
255 heads, 56 sectors/track, 3230 cylinders  
Units = cylinders of 14280 * 512 = 7311360 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disk identifier: 0x27cc1f5a


2,硬盤分區(qū)并查看分區(qū)情況



代碼如下:


[root@iZ94zz3wqciZ ~]# fdisk -S 56 /dev/xvdb      //分區(qū)  
 
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   //輸入n  
Command action  
  e   extended  
  p   primary partition (1-4)  
p  //主分區(qū)  
Partition number (1-4): 1   //分區(qū)號1  
First cylinder (1-3230, default 1):  
Using default value 1  
Last cylinder, +cylinders or +size{K,M,G} (1-3230, default 3230):  
Using default value 3230  
 
Command (m for help): wq   //保存并退出  
The partition table has been altered!  
 
[root@iZ94zz3wqciZ ~]# fdisk -l      
 
Disk /dev/xvda: 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: 0x00078f9c  
 
   Device Boot      Start         End      Blocks   Id  System  
/dev/xvda1   *           1        2611    20970496   83  Linux  
 
Disk /dev/xvdb: 23.6 GB, 23622320128 bytes  
255 heads, 56 sectors/track, 3230 cylinders  
Units = cylinders of 14280 * 512 = 7311360 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disk identifier: 0x27cc1f5a  
 
   Device Boot      Start         End      Blocks   Id  System  
/dev/xvdb1               1        3230    23062172   83  Linux    //分區(qū)后


3,格式化新分區(qū)xvdb1



代碼如下:


[root@iZ94zz3wqciZ ~]# mkfs.ext4 /dev/xvdb1   //格式化分區(qū)  
mke2fs 1.41.12 (17-May-2010)  
Filesystem label=  
OS type: Linux  
Block size=4096 (log=2)  
Fragment size=4096 (log=2)  
Stride=0 blocks, Stripe width=0 blocks  
1441792 inodes, 5765543 blocks  
288277 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  
8192 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 35 mounts or  
180 days, whichever comes first.  Use tune2fs -c or -i to override.


4,創(chuàng)建目錄,并掛載分區(qū)



代碼如下:


[root@iZ94zz3wqciZ ~]# mkdir /mnt/fastdfs    //掛載目錄  
[root@iZ94zz3wqciZ ~]# echo "/dev/xvdb1    /mnt/fastdfs    ext4    defaults    0 0" >> /etc/fstab   //重啟會自動掛載  
[root@iZ94zz3wqciZ ~]# mount -a    //掛載所有目錄  
 
[root@iZ94zz3wqciZ ~]# df  
Filesystem     1K-blocks     Used Available Use% Mounted on  
/dev/xvda1      20641404 14778404   4814476  76% /  
tmpfs             509300        0    509300   0% /dev/shm  
/dev/xvdb1      22694396   176064  21365516   1% /mnt/fastdfs    //新的分區(qū)已掛載



到這兒,就把一塊獨(dú)立的硬盤加到系統(tǒng)當(dāng)中了。這種擴(kuò)容的方式操作簡單,但是擴(kuò)展性不強(qiáng),不推薦這種擴(kuò)容方式。

二,采用lvm的方式,進(jìn)行硬盤擴(kuò)容(推薦)
1,取消前面測試的掛載,并刪除分區(qū)



代碼如下:


[root@iZ94zz3wqciZ ~]# umount -a         //取消掛載  
 
[root@iZ94zz3wqciZ ~]# fdisk /dev/xvdb   //分區(qū)  
 
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): d       //刪除分區(qū)  
Selected partition 1  
 
Command (m for help): wq     //保存  
The partition table has been altered!



2,安裝lvm



代碼如下:


[root@iZ94zz3wqciZ nginx]# uname -a   //查看內(nèi)核信息  
Linux iZ94zz3wqciZ 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux  
 
[root@iZ94zz3wqciZ ~]# yum install lvm2 device-mapper   //安裝 LVM2,2.6.9以后版本不用裝device-mapper  
 
[root@iZ94zz3wqciZ nginx]# lsmod | grep dm_mod    //是否加載了dm_mod  
dm_mod                 84337  5 dm_mirror,dm_log



lvm的安裝,首先加載device-mapper模塊,從linux內(nèi)核2.6.9開始,device-mapper模塊就已經(jīng)包含在內(nèi),所以你只需加載即可。加載mapper模塊:modprobe dm_mod。
3,創(chuàng)建lvm分區(qū)



代碼如下:


[root@iZ94zz3wqciZ ~]# fdisk /dev/xvdb   //分區(qū)  
 
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): l

0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris
1  FAT12           39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
2  XENIX root      3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
3  XENIX usr       40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
4  FAT16 <32M      41  PPC PReP Boot   85  Linux extended  c7  Syrinx
5  Extended        42  SFS             86  NTFS volume set da  Non-FS data
6  FAT16           4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
7  HPFS/NTFS       4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility
8  AIX             4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt
9  AIX bootable    50  OnTrack DM      93  Amoeba          e1  DOS access
a  OS/2 Boot Manag 51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O
b  W95 FAT32       52  CP/M            9f  BSD/OS          e4  SpeedStor
c  W95 FAT32 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs
e  W95 FAT16 (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  GPT
f  W95 Ext'd (LBA) 55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/  
10  OPUS            56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b  
11  Hidden FAT12    5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor  
12  Compaq diagnost 61  SpeedStor       a9  NetBSD          f4  SpeedStor  
14  Hidden FAT16 <3 63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary  
16  Hidden FAT16    64  Novell Netware  af  HFS / HFS+      fb  VMware VMFS  
17  Hidden HPFS/NTF 65  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE  
18  AST SmartSleep  70  DiskSecure Mult b8  BSDI swap       fd  Linux raid auto  
1b  Hidden W95 FAT3 75  PC/IX           bb  Boot Wizard hid fe  LANstep  
1c  Hidden W95 FAT3 80  Old Minix       be  Solaris boot    ff  BBT  
1e  Hidden W95 FAT1  
 
Command (m for help): n  
Command action  
  e   extended  
  p   primary partition (1-4)  
p  
Partition number (1-4): 1  
First cylinder (1-2871, default 1):  
Using default value 1  
Last cylinder, +cylinders or +size{K,M,G} (1-2871, default 2871):  
Using default value 2871  
 
Command (m for help): p  
 
Disk /dev/xvdb: 23.6 GB, 23622320128 bytes  
255 heads, 63 sectors/track, 2871 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: 0x27cc1f5a  
 
   Device Boot      Start         End      Blocks   Id  System  
/dev/xvdb1               1        2871    23061276   83  Linux      //不是lvm分區(qū)格式  
 
Command (m for help): t    //轉(zhuǎn)換  
Selected partition 1  
Hex code (type L to list codes): 8e     //換成8e  
Changed system type of partition 1 to 8e (Linux LVM)  
 
Command (m for help): p  
 
Disk /dev/xvdb: 23.6 GB, 23622320128 bytes  
255 heads, 63 sectors/track, 2871 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: 0x27cc1f5a  
 
   Device Boot      Start         End      Blocks   Id  System  
/dev/xvdb1               1        2871    23061276   8e  Linux LVM     //現(xiàn)在lvm分區(qū)格式了  
 
Command (m for help): wq  
The partition table has been altered!  
 
Calling ioctl() to re-read partition table.  
Syncing disks.



4,創(chuàng)建邏輯卷組,以及邏輯卷等



代碼如下:


[root@iZ94zz3wqciZ ~]# pvcreate /dev/xvdb1     //創(chuàng)建物理卷  
 Physical volume "/dev/xvdb1" successfully created  
 
[root@iZ94zz3wqciZ ~]# vgcreate myfiles /dev/xvdb1    //創(chuàng)建邏輯卷組  
 Volume group "myfiles" successfully created  
 
[root@iZ94zz3wqciZ ~]# vgchange -ay myfiles   //激活邏輯卷組  
 0 logical volume(s) in volume group "myfiles" now active  
 
[root@iZ94zz3wqciZ ~]# vgdisplay myfiles | grep "Total PE"    //查看該卷組所有的PE  
 Total PE              5629  
 
[root@iZ94zz3wqciZ ~]# lvcreate -l 5629 -n fastdfs myfiles    //創(chuàng)建邏輯卷  
 Logical volume "fastdfs" created.


 
5,格式化邏輯卷



代碼如下:


[root@iZ94zz3wqciZ ~]# mkfs.ext4 /dev/myfiles/fastdfs    //格式化邏輯卷  
mke2fs 1.41.12 (17-May-2010)  
Filesystem label=  
OS type: Linux  
Block size=4096 (log=2)  
Fragment size=4096 (log=2)  
Stride=0 blocks, Stripe width=0 blocks  
1441792 inodes, 5764096 blocks  
288204 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  
8192 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 39 mounts or  
180 days, whichever comes first.  Use tune2fs -c or -i to override.



6,設(shè)置自動掛載,并查看分區(qū)



代碼如下:


[root@iZ94zz3wqciZ ~]# echo '/dev/myfiles/fastdfs     /mnt/fastdfs            ext4    defaults        0 0' >> /etc/fstab   //自動掛載  
[root@iZ94zz3wqciZ ~]# mount -a     //手動掛載  
[root@iZ94zz3wqciZ ~]# df  
Filesystem           1K-blocks     Used Available Use% Mounted on  
/dev/xvda1            20641404 14778608   4814272  76% /  
tmpfs                   509300        0    509300   0% /dev/shm  
/dev/mapper/myfiles-fastdfs  
                     22694396   176064  21365516   1% /mnt/fastdfs     //lvm邏輯卷已掛載  
 
[root@iZ94zz3wqciZ ~]# reboot     //操作完好重啟一下



7,再擴(kuò)容一塊硬盤到已有邏輯卷



代碼如下:


[root@iZ94zz3wqciZ ~]# fdisk /dev/xvdc   //詳細(xì)過程同上,就不詳細(xì)說明了  
 
[root@iZ94zz3wqciZ ~]# reboot  
 
[root@iZ94zz3wqciZ ~]# pvcreate /dev/xvdc1     //創(chuàng)建物理卷  
 Physical volume "/dev/xvdc1" successfully created  
 
[root@iZ94zz3wqciZ ~]# vgextend myfiles /dev/xvdc1    //將新硬盤加入卷組  
 Volume group "myfiles" successfully extended  
 
[root@iZ94zz3wqciZ ~]# vgdisplay myfiles | grep "Total PE"  //查看所有PE  
 Total PE              6907  
 
[root@iZ94zz3wqciZ ~]# lvresize -l 6907 /dev/myfiles/fastdfs  //重新規(guī)定大小  
 Size of logical volume myfiles/fastdfs changed from 21.99 GiB (5629 extents) to 26.98 GiB (6907 extents).  
 Logical volume fastdfs successfully resized  
 
[root@iZ94zz3wqciZ ~]# resize2fs /dev/myfiles/fastdfs    //重新規(guī)定大小  
resize2fs 1.41.12 (17-May-2010)  
Filesystem at /dev/myfiles/fastdfs is mounted on /mnt/fastdfs; on-line resizing required  
old desc_blocks = 2, new_desc_blocks = 2  
Performing an on-line resize of /dev/myfiles/fastdfs to 7072768 (4k) blocks.  
The filesystem on /dev/myfiles/fastdfs is now 7072768 blocks long.  
 
[root@iZ94zz3wqciZ ~]# df -h  
Filesystem            Size  Used Avail Use% Mounted on  
/dev/xvda1             20G   15G  4.6G  76% /  
tmpfs                 498M     0  498M   0% /dev/shm  
/dev/mapper/myfiles-fastdfs  
                      27G  172M   26G   1% /mnt/fastdfs       //新的5G硬盤加上去了



如果是頻繁的擴(kuò)容硬盤的話,LVM是選,擴(kuò)展真的很方便。

感謝各位的閱讀,以上就是“Linux系統(tǒng)下怎么對硬盤分區(qū)進(jìn)行擴(kuò)容”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對Linux系統(tǒng)下怎么對硬盤分區(qū)進(jìn)行擴(kuò)容這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司,,小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!

網(wǎng)頁題目:Linux系統(tǒng)下怎么對硬盤分區(qū)進(jìn)行擴(kuò)容-創(chuàng)新互聯(lián)
文章網(wǎng)址:http://aaarwkj.com/article26/cogicg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣虛擬主機(jī)、品牌網(wǎng)站建設(shè)、App開發(fā)、網(wǎng)站導(dǎo)航、域名注冊

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設(shè)
国产精品九九久久精品三级| 自由成熟性生活免费视频| 国产国语网站在线观看| 国产精品三级竹菊影视| 亚洲一区精品中文字幕| 亚洲一区二区三区经典精品 | 国产精品原创传媒在线观看| 久久久久久成人综合色| 日韩精品亚洲一区二区三区免费| 黄色录像免费看中文字幕| 黄色亚洲一区二区三区四区| 精品伊人久久大香线蕉| 亚洲大乳大丰满中文字幕| 欧美性大片免费在线观看| 亚洲精品一区二区av| 日韩成人激情在线观看| 免费看夫妻性生活视频| 黄色av一本二本在线观看| 人妻少妇偷人精品免费看| 国产美女主播在线精品一区| 日韩欧美国产精品加勒比| 亚洲欧洲日本在线天堂| 日本一区二区不卡高清| 国产精品大屁股白浆一区二区 | 国产原创传媒在线观看| 亚洲天堂av现在观看| 最新日韩av一区二区| 亚洲国产日本一区自拍| 另类视频网站在线观看| 亚洲欧美日韩精品二区| 午夜体内射精免费视频| 视频一二区免费在线观看| 日本国产福利视频在线观看| 亚洲一区二区偷拍精品| 日韩中文字幕在线乱码| 国产乱一伦一性一情一色| av天堂高清在线观看| 欧美日韩在线视频一区| 青青草原这里只有精品| 日本高清免费黄色录像| 欧美福利免费在线视频|