非vg情况下无损扩展分区

六月ゝ 毕业季﹏ 提交于 2020-02-26 11:14:00

[root@server /]# 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): h
h: unknown command
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 
Value out of range.
Partition number (1-4): 
Value out of range.
Partition number (1-4): 1
First cylinder (1-913, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-913, default 913): 
Using default value 913

Command (m for help): p

Disk /dev/sdb: 7516 MB, 7516192768 bytes
255 heads, 63 sectors/track, 913 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: 0xc7e842cf

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         913     7333641   83  Linux

Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@server /]# e2
e2freefrag  e2fsck      e2image     e2label     e2undo      
[root@server /]# e2f
e2freefrag  e2fsck      
[root@server /]# e2fsck -f /dev/sdb
sdb   sdb1  
[root@server /]# e2fsck -f /dev/sdb
sdb   sdb1  
[root@server /]# e2fsck -f /dev/sdb1
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 12/327680 files (0.0% non-contiguous), 55902/1309289 blocks
[root@server /]# resize2fs -p /dev/sdb1
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/sdb1 to 1833410 (4k) blocks.
Begin pass 1 (max = 16)
Extending the inode table     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/sdb1 is now 1833410 blocks long.

[root@server /]# mount /dev/sdb
sdb   sdb1  
[root@server /]# mount /dev/sdb1 /data/
[root@server /]# ls
bin   data  etc   lib    lost+found  misc  net  proc  sbin     srv  tmp  var
boot  dev   home  lib64  media       mnt   opt  root  selinux  sys  usr
[root@server /]# cd /data/
[root@server data]# ls
111.txt  lost+found
[root@server data]# 
 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!