删除linux分区
‘壹’ 怎么删除linux分区
删除linux分区,用到的工具:xshell,步骤如下:
登录linux服务器,执行以下命令:
fdisk-l
输出以下信息:
Disk/dev/vda:32.2GB,32212254720bytes,62914560sectors
Units=sectorsof1*512=512bytes
Sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Disklabeltype:dos
Diskidentifier:0x000c1d0e
/dev/vda1*2048614420473072000083Linux
Disk/dev/vdb:75.2GB,75161927680bytes,146800640sectors
Units=sectorsof1*512=512bytes
Sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Disklabeltype:dos
Diskidentifier:0x000cc312
/dev/
说明:测试服务器有两个分区,vda1和vdb1。
效果图:
d
然后选择分区号
最后输入w保存。
注意事项:删除分区前备份数据。
‘贰’ 关于删除linux分区
先进BIOS把ACHI关掉(不同主板不同方法,你网络下你的电脑怎么关ACHI,必须关掉,XP默认不支持SATA,否则安装或者启动XP的时候会蓝屏)
然后网络大白菜PE,下载大白菜PE安装包
找个空U盘(mp3,手机都不行),然后安装大白菜PE到U盘
重启电脑进入U盘系统(有些电脑开机后狂按F12进入启动选择项,有些是按enter再按F12进入)
启动PE,找到开始程序里面的PM分区工具
然后就可以删除linux分区了(删除linux的ext和swap分区后,新建NTFS分区,激活想要安装XP系统的那个分区,然后修复MBR)
安装XP系统吧
‘叁’ windows无法删除Linux分区吗
windows是可以删除linux分区的。在计算机管理里选择磁盘管理,在磁盘管理里就可以看到任何格式的分区,包括linux的分区,在这里只要选择删除分区就可以删除你说选择的分区。当然也可以在Windows下运行一些分区软件来删除同机下的linux分区。
‘肆’ linux下如何删除磁盘分区
以RH9为例,上面有只有两个分区
/dev/sda1
和/dev/sda2
#fdisk
/dev/sda
(注意sda后不要加数字)
command(m
for
help):
m
输入m后,就会看到很多命令
command(m
for
help):
p
输出当前磁盘的状态
command(m
for
help):
q
想要不存储离开吗?按下q,请不要随便按w
新增分区:#fdisk
/dev/sda
command(m
for
help):
n
此时系统会提示新增P(主分区)还是E(扩展分区),系统一般是(4个P)+E,而且E分区号必须从5开始
p
这里自行决定是P还是E
Partition
number(1-4):3
编号可以随意
First
cylinder:
这里按下ENTER就行了
Last
cylinder
or
..............:
+100M
再输入P的时候就能看到新增的分区了
删除分区:
#fdisk
/dev/sda
command(m
for
help):
d
选择分区号
记住q---不存储离开
w---存储离开
附上容易混淆的两个命令:
df(disk
free)---显示磁盘的文件系统与使用情形
(disk
usage)---显示指定的目录或文件所占用的磁盘空间
‘伍’ linux怎么删除分区
fdisk命令可以对磁盘分区进行维护,包括查询,增加,删除等功能
使用方法:
fdisk /dev/xxxx
进入后,p命令显示当前分区表信息,其它操作可以通过帮助命令了解。
‘陆’ linux 删除lvm分区
这里以red hat as4 为例。当磁盘分区发现不够用时,能想道的第一个做法就是增加分区大小。但是一般linux如果没有采用逻辑卷管理,则动态增加分区大小很困难,一个能想道的办法就是,备份分区文件系统数据,删除分区,然后再重新创建分区,恢复备份的文件系统,这个做法比较玄,可能删除分区后导致系统无法启动。
第二个做法就是,创建一个新的逻辑分区(当然必须有未使用的磁盘空间能分配),将文件系统从老分区拷贝到新分区,然后修改fstab,使用新分区/文件系统替换老的分区/文件系统
第三种做法是,创建一个新的逻辑分区,将新的逻辑分区格式化ext3(或其他类型)的文件系统,mount到磁盘空间不够的文件系统,就跟原来的分区/文件系统一样的使用。
‘柒’ Linux使用fdisk删除分区详解
在磁盘/dev/sdb 上有一个分区sdb1,现需要删除sdb1分区
使用fdisk /dev/sdb 进行操作
现在使用lsblk查看,发现sdb1分区已经删除
‘捌’ 如何删除linux系统及其分区
我们不但要知道如何安装linux系统,也应该知道如何卸载linux
在linux和windows共存的情况下,如果删除linu所占分区,可以用以下方法。
windows系统可能无法识别linux系统分区,我们可以利用linux本身的fdisk切割程序删除linux分区:
[root@free root]# fdisk
/dev/hda
←指定linux分区所在的硬盘Command (m for
help):p
←显示目前硬盘分割情况Disk /dev/hda:64headers,63 sectors,1015 cylinders
Units = cylinders of 4032 * 512 bytes
Device
Boot
Start
End
Blocks
Id System/dev/hda1
*
1
254512032+
6
FAT16
←此为DOS/windows分区/dev/hda22559641431360
83Linux/dev/hda3
9651015
1028165
Extented/dev/hda59651015
102784+82
SwapCommand (m for help):d
Partition number
(1-5):5←删除第5号分区Command (m for help):d
Partition number
(1-5):3←删除第3号分区Command (m for help):d
Partition number
(1-4):2←删除第2号分区Command (m for
help):p←再显示一次目前硬盘分割情况Disk /dev/hda:64headers,63 sectors,1015
cylindersUnits = cylinders of 4032 * 512 bytes
Device
Boot
Start
End
Blocks
Id System/dev/hda1
*
1
254512032+
6
FAT16
←只剩下DOS/windows分区Command (m for
help):w←将所更改的结果写入到硬盘然后会显示提示信息,系统在重启后更改磁盘
[root@free root]# reboot
删除linux后如何进入windows系统
在windows与linux系统共存的情况下,删除了linux分区后,可能会不能正常进入windows系统。若在安装linux时使用Grub开机管理程序,并将其安装在MBR中,删除linux分区后,由于/boot的相关文件已被删除,所以只会出现一行提示符:
grub>
这是可用下列方式启动进入windows:
grub> rootnoverify
(hd0,0)
←指定windows分区为第一硬盘的第一分区grub>chainloader
+1
←读取第一扇区中的启动程序grub>makeactive
←设置可启动grub>
boot
←启动若将lilo安装在MBR中,开机启动时还会显示lilo的启动菜单,可选择进入windows,但已不能进入linux系统汇中。
也可在DOS模式下重写MBR,即可删除lilo或grub,开机默认启动到windows系统。
‘玖’ linux下如何删除磁盘分区
分区示例:比如分/dev/sda 硬盘
#: fdisk /dev/sda
The number of cylinders for this disk is set to 19457.
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): m #帮助,输入M
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 #删除分区
Partition number (1-8): 2
Command (m for help): p # 打印分区表
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0003ce53
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3825 30720000 7 HPFS/NTFS
/dev/sda3 7650 11474 30720000 7 HPFS/NTFS
/dev/sda4 11475 19457 64123447+ 5 Extended
/dev/sda5 11475 14444 23856472+ 7 HPFS/NTFS
/dev/sda6 19247 19457 1694826 82 Linux swap / Solaris
/dev/sda7 14445 15660 9767488+ 83 Linux
/dev/sda8 15661 19246 28804513+ 83 Linux
Partition table entries are not in disk order
Command (m for help): n #建立新分区
Command action
l logical (5 or over)
p primary partition (1-4)
p #主分区
Selected partition 2
First cylinder (3825-19457, default 3825): 可以选
Using default value 3825
Last cylinder, +cylinders or +size{K,M,G} (3825-7649, default 7649): 输入分区大小 比如100G
Using default value 7649
Command (m for help):