linux sdb分区大小不对,Linux下使用fdisk扩大分区容量(不丢失数据)

环境:

模拟新加一块磁盘,并分区,挂载,永久挂载,然后写入数据,然后对分区扩容,测试扩容后分区里面的内容是否丢失。

查看所有分区:

[root@backup

~]#fdisk

-l

Disk

/dev/sda: 1073.7 GB, 1073741824000 bytes

255 heads, 63 sectors/track, 130541

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: 0x00040b96

Device Boot      Start         End      Blocks   Id  System

/dev/sda1

*           1          26      204800   83  Linux

Partition

1 does not end on cylinder boundary.

/dev/sda2

26        1070     8388608   82  Linux swap / Solaris

/dev/sda3

1070       13055    96263168   83  Linux

Disk

/dev/sdb: 1073.7 GB, 1073741824000 bytes

255

heads, 63 sectors/track, 130541 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: 0x00000000

开始分区:

[root@backup

~]#fdisk

/dev/sdb

Device

contains neither a valid DOS partition table, nor Sun, SGI or OSF

disklabel

Building a new DOS disklabel with disk identifier 0xc6e44e94.

Changes

will remain in memory only, until you decide to write them.

After

that, of course, the previous content won't be recoverable.

Warning:

invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): p

#p是打印当前磁盘所有分区Disk /dev/sdb: 1073.7 GB, 1073741824000 bytes

255

heads, 63 sectors/track, 130541 cylinders

Units

= cylinders of 16065 * 512 = 8225280 bytes

Sector

size (logical/physical): 512 bytes / 512 bytes

I/O

size (minimum/optimal): 512 bytes / 512 by

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值