linux格式化扩展分区报错解决

Linux格式化扩展分区时会报错,因为Linux扩展分区格式化无意义,它是为logicalpartition服务的,它们大小一

样。在一块硬盘里你最多只能创造fourpartiton,包括主分区与expand分区,而一个expand分区可以创造去多个

logicalpartition,是在logicalpartition使用space的。此时,为了解决问题,可以在扩展分区上创建主分区(p)

或逻辑分区(l)

 

以下演示出错解决过程:

1、创建扩展分区

[root@localhosttmp]# fdisk /dev/sda

WARNING:DOS-compatible mode is deprecated. It's strongly recommended to

switchoff the mode (command 'c') and change display units to

sectors(command 'u').

 

Command(m for help): n

Firstcylinder (4106-4178, default 4106):

Usingdefault value 4106

Lastcylinder, +cylinders or +size{K,M,G} (4106-4178, default 4178): +100M

 

Command(m for help): W

Thepartition table has been altered!

 

Callingioctl() to re-read partition table.

 

WARNING:Re-reading the partition table failed with error 16: 设备或资源忙.

Thekernel still uses the old table. The new table will be used at

thenext reboot or after you run partprobe(8) or kpartx(8)

Syncingdisks.

[root@localhosttmp]# fdisk -l

 

Disk/dev/sda: 34.4 GB, 34359738368 bytes

255heads, 63 sectors/track, 4177 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

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

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0x0003d455

 

DeviceBoot Start End Blocks Id System

/dev/sda1 * 1 128 1024000 83 Linux

Partition1 does not end on cylinder boundary.

/dev/sda2 128 2040 15360000 83 Linux

/dev/sda3 2040 3825 14336000 83 Linux

/dev/sda4 3825 4178 2833408 5 Extended

/dev/sda5 3825 4106 2252800 82 Linux swap / Solaris

/dev/sda6 4106 4119 109964 83 Linux

 

2、格式化磁盘分区

[root@localhost~]# mount /dev/sda6 /data

mount:you must specify the filesystem type

显示分区未格式化

[root@localhost~]# mkfs -t ext3 -c /dev/sda6

mke2fs1.41.12 (17-May-2010)

mkfs.ext3:inode_size (128) * inodes_count (0) too big for a

filesystemwith 0 blocks, specify higher inode_ratio (-i)

orlower inode count (-N).

 

3、格式化扩展分区报错解决

格式磁盘时发现如下错误,原因是扩展分区无法格式化,

解决方法是在扩展分区上创建主分区(p)或逻辑分区(l)

[root@localhost~]# fdisk /dev/sda6

Devicecontains neither a valid DOS partition table, nor Sun, SGI or OSFdisklabel

Buildinga new DOS disklabel with disk identifier 0xcbd45cde.

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

Afterthat, 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

switchoff the mode (command 'c') and change display units to

sectors(command 'u').

 

Command(m for help): p

 

Disk/dev/sda6: 112 MB, 112603136 bytes

255heads, 63 sectors/track, 13 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

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

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0xcbd45cde

 

DeviceBoot Start End Blocks Id System

 

Command(m for help): n

Commandaction

e extended

p primary partition (1-4)

p

Partitionnumber (1-4): 1

Firstcylinder (1-13, default 1):

Usingdefault value 1

Lastcylinder, +cylinders or +size{K,M,G} (1-13, default 13): 13M

 

Command(m for help): P

 

Disk/dev/sda6: 112 MB, 112603136 bytes

255heads, 63 sectors/track, 13 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

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

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0xcbd45cde

 

DeviceBoot Start End Blocks Id System

/dev/sda6p1 1 13 104391 83 Linux

 

Command(m for help): W

Thepartition table has been altered!

 

Callingioctl() to re-read partition table.

 

WARNING:Re-reading the partition table failed with error 22: 无效的参数.

Thekernel still uses the old table. The new table will be used at

thenext reboot or after you run partprobe(8) or kpartx(8)

Syncingdisks.

此处要重启使生效,也可以使用partprobe命令

[root@localhost~]# partprobe

Warning:WARNING: the kernel failed to re-read the partition table on /dev/sda(设备或资源忙). As a

result, it may not reflect all of your changes until afterreboot.

Warning:无法以读写方式打开/dev/sr0(只读文件系统)。/dev/sr0已按照只读方式打开。

Warning:无法以读写方式打开/dev/sr0(只读文件系统)。/dev/sr0已按照只读方式打开。

Error:无效的分区表 -/dev/sr0 出现递归分区。

[root@localhost~]# fdisk -l

Disk/dev/sda: 34.4 GB, 34359738368 bytes

255heads, 63 sectors/track, 4177 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

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

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0x0003d455

 

DeviceBoot Start End Blocks Id System

/dev/sda1 * 1 128 1024000 83 Linux

Partition1 does not end on cylinder boundary.

/dev/sda2 128 2040 15360000 83 Linux

/dev/sda3 2040 3825 14336000 83 Linux

/dev/sda4 3825 4178 2833408 5 Extended

/dev/sda5 3825 4106 2252800 82 Linux swap / Solaris

/dev/sda6 4106 4119 109964 83 Linux

[root@localhost~]# mkdir /data

再次格式化,显示格式化成功。

[root@localhost~]# mkfs.ext3 /dev/sda6

mke2fs1.41.12 (17-May-2010)

文件系统标签=

操作系统:Linux

块大小=1024(log=0)

分块大小=1024(log=0)

Stride=0blocks, Stripe width=0 blocks

27552inodes, 109964 blocks

5498blocks (5.00%) reserved for the super user

第一个数据块=1

Maximumfilesystem blocks=67371008

14block groups

8192blocks per group, 8192 fragments per group

1968inodes per group

Superblockbackups stored on blocks:

8193,24577, 40961, 57345, 73729

 

正在写入inode表:完成

Creatingjournal (4096 blocks): 完成

Writingsuperblocks and filesystem accounting information: 完成

 

Thisfilesystem will be automatically checked every 24 mounts or

180days, whichever comes first. Use tune2fs -c or -i to override.

 

4、再次挂载磁盘分区,挂载成功

[root@localhost~]# mount /dev/sda6 /data

[root@localhost~]# df -hT

[root@localhost/]# df -hT

Filesystem Type Size Used Avail Use% Mounted on

/dev/sda2 ext4 15G 8.4G 5.9G 59% /

/dev/sda1 ext4 969M 54M 865M 6% /boot

/dev/sda3 ext4 14G 525M 13G 5% /home

/dev/sr0 iso9660 1.8G 1.8G 0 100% /mnt/iso

share vboxsf 222G 93G 129G 42% /mnt/share

/dev/sda6 ext3 104M 5.7M 93M 6% /data

 

<think>嗯,用户问的是关于“x1600 Linux分区”的内容。首先,我需要确定“x1600”具体指的是什么。可能的情况有很多,比如某个硬件型号、分区方案、软件工具,或者是某种特定的配置。不过,在Linux分区的上下文中,常见的元素包括分区工具(如fdisk、parted)、文件系统类型(如ext4、XFS)、分区方案(如MBR、GPT)以及RAID或LVM配置等。 首先,用户可能是在使用某个名为x1600的工具或设备,或者是遇到了与x1600相关的分区问题。比如,x1600可能是一个服务器型号,如惠普ProLiant DL1600系列,这类服务器在安装Linux时需要特定的分区设置。或者是某种分区方案,比如分区大小设置为1600GB,用户想了解如何合理分区。 接下来,我需要考虑用户可能的实际需求。如果x1600指的是服务器型号,用户可能需要了解在这样的硬件上安装Linux时的最佳分区实践,比如是否需要单独的/boot、/、/home、swap等分区,或者是否需要考虑RAID配置。如果是分区大小的问题,用户可能想知道如何分配1600GB的硬盘空间,合理划分系统分区、数据分区等。 另外,用户可能遇到了错误信息,比如在分区过程中出现“x1600”相关的报错,需要排查原因。这时候需要检查分区工具的使用方法,确认分区表类型(GPT vs MBR),文件系统格式是否正确,或者是否有硬件兼容性问题。 还需要考虑用户的知识水平。如果用户是初学者,可能需要更基础的分区概念解释,比如主分区扩展分区、逻辑分区的区别,或者如何使用图形化工具(如GParted)进行操作。如果是高级用户,可能需要更深入的指导,比如使用parted命令行工具,或者配置LVM、RAID等。 可能的误解是用户将“x1600”误写或打错,比如实际是某个命令或配置参数。这时候需要提示用户确认术语的正确性,或者提供常见分区相关术语的解释,帮助用户更准确地描述问题。 总结来说,用户的需求可能涉及以下几个方面: 1. 在x1600硬件上安装Linux分区建议。 2. 如何将1600GB的硬盘合理分区。 3. 解决与x1600相关的分区错误。 4. 使用特定工具或方法进行分区的步骤。 接下来,我需要组织回答的结构,确保覆盖这些可能性,同时引导用户提供更多信息以便更精准地解答。需要分步骤解释,保持清晰,并确保使用正确的中文术语和LaTeX格式的数学表达式(如果涉及计算的话),但根据问题内容,可能数学公式较少,更多是命令行示例或分区方案建议。需要检查是否有必要使用独立公式块,比如在解释分区大小计算时,但通常可能不需要。因此,回答应侧重于分区概念、工具使用、常见方案及故障排除建议。</think>关于“x1600 Linux分区”,目前信息不够明确。以下是可能涉及的方向及详细解释,请根据实际情况参考: --- ### 1. **若“x1600”指硬盘容量(如1600GB)** #### 典型Linux分区方案建议: - **`/boot`分区** - 大小:1GB - 作用:存放内核和启动文件,建议独立分区避免系统无法启动。 - 文件系统:ext4 - 命令示例: ```bash parted /dev/sda mkpart primary ext4 1MiB 1025MiB ``` - **`/`(根分区)** - 大小:30-50GB - 作用:系统核心文件和应用程序。 - 文件系统:ext4/XFS - 命令示例: ```bash parted /dev/sda mkpart primary ext4 1025MiB 50GiB ``` - **`/home`分区** - 大小:剩余大部分空间(如1400GB) - 作用:用户数据存储,独立分区可避免重装系统时数据丢失。 - 文件系统:ext4/XFS - 命令示例: ```bash parted /dev/sda mkpart primary ext4 50GiB 100% ``` - **交换分区(Swap)** - 大小:物理内存的1-2倍(若内存≥16GB,可不设或设4-8GB) - 作用:内存扩展,休眠支持。 - 命令示例: ```bash parted /dev/sda mkpart primary linux-swap 50GiB 54GiB ``` --- ### 2. **若“x1600”指特定设备或服务器型号** #### 常见场景(如HPE ProLiant DL1600服务器): - **RAID配置建议**: - 使用硬件RA卡(如HPE Smart Array)创建RAID1(系统盘)和RAID5/RAID10(数据盘)。 - 工具:HPE Intelligent Provisioning或`ssacli`命令行工具。 - **分区工具选择**: - 推荐`parted`或`fdisk`(支持GPT分区表): ```bash parted /dev/sda mklabel gpt parted /dev/sda mkpart primary ext4 1MiB 100% ``` --- ### 3. **若遇到“x1600”相关报错** #### 常见问题排查: - **分区表类型错误**: - 错误现象:安装时提示“无法在设备上创建分区”。 - 解决方案:使用`parted`切换为GPT分区表: ```bash parted /dev/sda mklabel gpt ``` - **4K对齐问题**: - 错误现象:性能低下或I/O错误。 - 解决方案:分区时起始位置按1MiB对齐(现代硬盘通用): ```bash parted -a optimal /dev/sda mkpart primary ext4 1MiB 100% ``` --- ### 4. **扩展建议** - **LVM配置**: - 灵活调整分区大小,适合动态需求: ```bash pvcreate /dev/sda1 vgcreate vg0 /dev/sda1 lvcreate -L 50G -n root vg0 ``` - **文件系统选择**: - 高并发场景选XFS,普通用途选ext4。 --- 请补充具体场景(如硬件型号、报错信息或分区用途),以便提供更精准的指导!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值