麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 系統 > CentOS > 正文

centos下如何使用fdisk擴展分區容量大小

2020-07-08 12:49:21
字體:
來源:轉載
供稿:網友

擴展磁盤空間

硬盤空間為20G,使用vSphere Client增加磁盤大小,需要再增加10G空間;

fdisk_l-20G

vshere_add

擴展完后,重啟系統,再次使用fdisk -l查看,會發現硬盤空間變大了;

[root@linuxprobe ~]# fdisk -lDisk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0005210c   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          26      204800   83  LinuxPartition 1 does not end on cylinder boundary./dev/sda2              26        1301    10240000   83  Linux/dev/sda3            1301        1497     1572864   82  Linux swap / Solaris/dev/sda4            1497        2611     8952832   83  Linux[root@linuxprobe ~]# df -hTFilesystem     Type   Size  Used Avail Use% Mounted on/dev/sda2      ext4   9.7G  1.5G  7.7G  16% /tmpfs          tmpfs  939M     0  939M   0% /dev/shm/dev/sda1      ext4   194M   34M  151M  19% /boot/dev/sda4      ext4   8.5G  148M  7.9G   2% /data

fdisk_l-30

重新創建分區,調整分區信息

本次實驗主要對/dev/sda4這個分區擴展,如果是生產環境,請提前做好備份保存到其他分區,雖然擴展分區大小不會導致數據丟失,安全起見,請提前做好備份;

首先模擬出一些數據:

[root@linuxprobe data]# mkdir test[root@linuxprobe data]# echo "we are Linuxer" > linuxprobe[root@linuxprobe data]# lltotal 24-rw-r--r--. 1 root root    15 May 23 21:59 linuxprobedrwx------. 2 root root 16384 May 23 15:07 lost+founddrwxr-xr-x. 2 root root  4096 May 23 21:51 test[root@linuxprobe ~]# umount /dev/sda4          #卸載磁盤分區

若提示磁盤忙,使用fuser找出將正在使用磁盤的程序并結束掉;

fuser -m -v /datafuser -m -v -i -k /data

使用fdisk工具先刪除/dev/sda4分區,然后創建新分區,注意開始的磁柱號要和原來的一致(是保證數據不丟失的關鍵步驟),結束的磁柱號默認回車使用全部磁盤。

[root@linuxprobe ~]# fdisk /dev/sdaWARNING: 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): p        #查看分區表信息Disk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0005210c   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          26      204800   83  LinuxPartition 1 does not end on cylinder boundary./dev/sda2              26        1301    10240000   83  Linux/dev/sda3            1301        1497     1572864   82  Linux swap / Solaris/dev/sda4            1497        2611     8952832   83  LinuxCommand (m for help): d           #刪除分區Partition number (1-4): 4         #刪除第四個Command (m for help): p       #再次查看分區信息,/dev/sda4已被刪除Disk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0005210c   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          26      204800   83  LinuxPartition 1 does not end on cylinder boundary./dev/sda2              26        1301    10240000   83  Linux/dev/sda3            1301        1497     1572864   82  Linux swap / SolarisCommand (m for help): n      #創建新的分區Command action   e   extended   p   primary partition (1-4)p             #創建為主分區Selected partition 4First cylinder (1497-3916, default 1497):          #經對比,正好和上一個磁盤柱一致,默認即可Using default value 1497Last cylinder, +cylinders or +size{K,M,G} (1497-3916, default 3916): Using default value 3916              #直接默認就可以Command (m for help): p               #查看分區表信息Disk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0005210c   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          26      204800   83  LinuxPartition 1 does not end on cylinder boundary./dev/sda2              26        1301    10240000   83  Linux/dev/sda3            1301        1497     1572864   82  Linux swap / Solaris/dev/sda4            1497        3916    19436582   83  LinuxCommand (m for help): wp       #保存并退出,如果創建有誤,直接退出不要保存即可The partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device or resource busy.The kernel still uses the old table. The new table will be used atthe next reboot or after you run partprobe(8) or kpartx(8)Syncing disks.

重新創建分區后,需要重啟一下;

[root@linuxprobe ~]# init 6[root@linuxprobe ~]# e2fsck -f /dev/sda4                #檢查分區信息[root@linuxprobe ~]# resize2fs -p /dev/sda4             #調整分區大小

重新掛載、查看分區大小、數據

[root@linuxprobe ~]# mount /dev/sda4 /data[root@linuxprobe ~]# df -hT[root@linuxprobe ~]# cat /data/linuxprobewe are  Linuxer

df-hT_19G

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 一级黄色毛片免费 | 一级免费大片 | 久久精品欧美电影 | 91精品观看91久久久久久国产 | 日韩激情 | 成人一级片毛片 | 国产在线精品一区二区不卡 | 国产日韩在线 | 久久精品美乳 | 久久网站热最新地址 | 午夜在线视频一区二区三区 | 欧美成人三级视频 | 19禁国产精品福利视频 | 欧美日韩一区二区综合 | 日本在线不卡一区二区三区 | 久久精品日产第一区二区三区 | 毛片毛片| 亚洲精品com| 宅男噜噜噜66国产在线观看 | 精品国产一区二 | 操操操日日日干干干 | 成人免费在线视频 | 国产精品午夜未成人免费观看 | 欧美成人精品一区二区三区 | 久久久99精品视频 | 91女上位 在线播放 性欧美日本 | 亚洲国产美女视频 | 欧美日韩手机在线观看 | 牛牛a级毛片在线播放 | av在线一区二区三区四区 | 懂色av懂色aⅴ精彩av | 久久精品av| 91羞羞| 舌头伸进添的我好爽高潮网站 | 欧美一级棒| 国产 日韩 亚洲 欧美 | 国产毛片网 | 久色成人 | 18被视频免费观看视频 | 精品国产一区二区三区在线观看 | 国产精品久久久久久久不卡 |