msdos & gpt

[root@oratest ~]# fdisk /dev/sde   【该虚拟硬盘4T】
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 4194304.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

WARNING: The size of this disk is 4.4 TB (4398046511104 bytes).
DOS partition table format can not be used on drives for volumes
larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID 
partition table format (GPT).

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

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4194304, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2097151, default 2097151): 
Using default value 2097151

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

Calling ioctl() to re-read partition table.
Syncing disks


######### 两个盘比对

[root@oratest ~]# fdisk /dev/sdd

The number of cylinders for this disk is set to 6527.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): ^X^Z
[1]+  Stopped                 fdisk /dev/sdd
[root@oratest ~]# fdisk /dev/sde

The number of cylinders for this disk is set to 4194304.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)


WARNING: The size of this disk is 4.4 TB (4398046511104 bytes).
DOS partition table format can not be used on drives for volumes
larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID 
partition table format (GPT).


Command (m for help): 

[root@oratest ~]#  parted -s /dev/sde print
Error: msdos labels do not support devices that have more than 4895534909461889023 sectors.
[root@oratest ~]# fdisk /dev/sde

The number of cylinders for this disk is set to 4194304.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)


WARNING: The size of this disk is 4.4 TB (4398046511104 bytes).
DOS partition table format can not be used on drives for volumes
larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID 
partition table format (GPT).

Command (m for help): d
Selected partition 1

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

Calling ioctl() to re-read partition table.

Syncing disks.

【删除不起作用】

[root@oratest ~]#  parted -s /dev/sde print
Error: msdos labels do not support devices that have more than 4895534909461889023 sectors.
[root@oratest ~]# 

[root@oratest ~]# parted /dev/sde
GNU Parted 1.8.1
Using /dev/sde
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help                                                             
  check NUMBER                             do a simple check on the file system
  cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition
  help [COMMAND]                           prints general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partititon NUMBER
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system
  move NUMBER START END                    move partition NUMBER
  name NUMBER NAME                         name partition NUMBER as NAME
  print [free|NUMBER|all]                  display the partition table, a partition, or all devices
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resize NUMBER START END                  resize partition NUMBER and its file system
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  displays the current version of GNU Parted and copyright information
(parted) mklabel gpt
(parted) l                                                                
  check NUMBER                             do a simple check on the file system
  cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition
  help [COMMAND]                           prints general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partititon NUMBER
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system
  move NUMBER START END                    move partition NUMBER
  name NUMBER NAME                         name partition NUMBER as NAME
  print [free|NUMBER|all]                  display the partition table, a partition, or all devices
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resize NUMBER START END                  resize partition NUMBER and its file system
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  displays the current version of GNU Parted and copyright information
(parted) p                                                                
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sde: 4398GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted)                                                                  
(parted)                                                                  
[3]+  Stopped                 parted /dev/sde
[root@oratest ~]#  parted -s /dev/sde print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sde: 4398GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt


Number  Start  End  Size  File system  Name  Flags

【修改失败】
[root@oratest ~]# parted /dev/sde
GNU Parted 1.8.1
Using /dev/sde
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos                                                    
Warning: The existing disk label on /dev/sde will be destroyed and all data on this disk will be lost. Do you want to continue?
parted: invalid token: msdos
Yes/No? yes                                                               
New disk label type?  [gpt]? modos                                        
parted: invalid token: modos
New disk label type?  [gpt]? N                                            
parted: invalid token: N
New disk label type?  [gpt]? MODOS                                        
parted: invalid token: MODOS
New disk label type?  [gpt]? msdos                                        
Error: msdos labels do not support devices that have more than 4294967295 sectors.
(parted) quit                                                             
Information: Don't forget to update /etc/fstab, if necessary.             

[root@oratest ~]#  parted -s /dev/sde print

Model: VMware, VMware Virtual S (scsi)
Disk /dev/sde: 4398GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt


Number  Start  End  Size  File system  Name  Flags

[root@oratest ~]# 


[root@oratest ~]#  parted -s /dev/sde print


Model: VMware, VMware Virtual S (scsi)
Disk /dev/sde: 4398GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flag
[root@oratest ~]# 
--无法修改过来---  
[root@oratest ~]#  parted -s /dev/sdf print
Error: Unable to open /dev/sdf - unrecognised disk label.
[root@oratest ~]# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 7179.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): 1
First cylinder (1-7179, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-7179, default 7179): 
Using default value 7179

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@oratest ~]#  parted -s /dev/sdf print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdf: 59.1GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos


Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  59.0GB  59.0GB  primary                    


[root@oratest ~]# 
[root@oratest ~]# parted /dev/sdf
GNU Parted 1.8.1

Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help
  check NUMBER                             do a simple check on the file system
  cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition
  help [COMMAND]                           prints general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partititon NUMBER
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system
  move NUMBER START END                    move partition NUMBER
  name NUMBER NAME                         name partition NUMBER as NAME
  print [free|NUMBER|all]                  display the partition table, a partition, or all devices
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resize NUMBER START END                  resize partition NUMBER and its file system
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  displays the current version of GNU Parted and copyright information
(parted) mklabel gpt                                                      
Warning: The existing disk label on /dev/sdf will be destroyed and all data on this disk will be lost. Do you want to continue?
parted: invalid token: gpt
Yes/No? yes                                                               
New disk label type?  [msdos]? gpt                                        
(parted) quit                                                             
Information: Don't forget to update /etc/fstab, if necessary.             

[root@oratest ~]#   parted -s /dev/sdf print

Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdf: 59.1GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

[root@oratest ~]# 
可以修改成功
[root@oratest ~]# parted /dev/sdf
GNU Parted 1.8.1
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel modos
Warning: The existing disk label on /dev/sdf will be destroyed and all data on this disk will be lost. Do you want to continue?
parted: invalid token: modos
Yes/No? yes                                                               
New disk label type?  [gpt]? msdos
(parted) quit                                                             
Information: Don't forget to update /etc/fstab, if necessary.             

[root@oratest ~]#  parted -s /dev/sdf print

Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdf: 59.1GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number  Start  End  Size  Type  File system  Flags
[root@oratest ~]# 

可以成功修改


新的硬盘是没有msdos gtp列表的,所以阵列重新划分是可以的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值