有幾種選擇:1,如果你不用linux系統(tǒng),那么直接那個windows7光盤重裝就行(設置為cdrom啟動),win7會覆蓋原來的mbr表(不懂mbr的不用理會,直接按提示操作即可)。

創(chuàng)新互聯2013年開創(chuàng)至今,是專業(yè)互聯網技術服務公司,擁有項目成都網站設計、成都網站建設網站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元大寧做網站,已為上家服務,為大寧各地企業(yè)和個人服務,聯系電話:13518219792
2,你要用linux系統(tǒng)和win7系統(tǒng),那么也得先裝上win7,再裝linux系統(tǒng),因為windows比較霸道,見mbr表就覆蓋。
總之,如果你只要win7 系統(tǒng)的話 問題好解決,直接重裝系統(tǒng)。至于怎么裝系統(tǒng),呵呵,你懂得。
fdisk命令可以對磁盤分區(qū)進行維護,包括查詢,增加,刪除等功能
使用方法:
fdisk /dev/xxxx
進入后,p命令顯示當前分區(qū)表信息,其它操作可以通過幫助命令了解。
我們不但要知道如何安裝linux系統(tǒng),也應該知道如何卸載linux
在linux和windows共存的情況下,如果刪除linu所占分區(qū),可以用以下方法。
windows系統(tǒng)可能無法識別linux系統(tǒng)分區(qū),我們可以利用linux本身的fdisk切割程序刪除linux分區(qū):
[root@free root]# fdisk
/dev/hda??
←指定linux分區(qū)所在的硬盤
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???????
254???512032+???
6????
FAT16????
←此為DOS/windows分區(qū)
/dev/hda2??????????????????????255?????964??1431360
83???Linux
/dev/hda3?????????????????????
965???1015???
102816????5????
Extented
/dev/hda5??????????????????????965???1015???
102784+????82????
Swap
Command (m for help):d
Partition number
(1-5):5????????←刪除第5號分區(qū)
Command (m for help):d
Partition number
(1-5):3????????←刪除第3號分區(qū)
Command (m for help):d
Partition number
(1-4):2????????←刪除第2號分區(qū)
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???????
254???512032+???
6????
FAT16????
←只剩下DOS/windows分區(qū)
Command (m for
help):w???????←將所更改的結果寫入到硬盤
然后會顯示提示信息,系統(tǒng)在重啟后更改磁盤
[root@free root]# reboot
刪除linux后如何進入windows系統(tǒng)
在windows與linux系統(tǒng)共存的情況下,刪除了linux分區(qū)后,可能會不能正常進入windows系統(tǒng)。若在安裝linux時使用Grub開機管理程序,并將其安裝在MBR中,刪除linux分區(qū)后,由于/boot的相關文件已被刪除,所以只會出現一行提示符:
grub
這是可用下列方式啟動進入windows:
grub rootnoverify
(hd0,0)?????
←指定windows分區(qū)為第一硬盤的第一分區(qū)
grub?chainloader
+1????????????
←讀取第一扇區(qū)中的啟動程序
grub?makeactive????????????
←設置可啟動
grub
boot?????????????????????????
←啟動
若將lilo安裝在MBR中,開機啟動時還會顯示lilo的啟動菜單,可選擇進入windows,但已不能進入linux系統(tǒng)匯中。
也可在DOS模式下重寫MBR,即可刪除lilo或grub,開機默認啟動到windows系統(tǒng)。
分區(qū)示例:比如分/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 刪除一個分區(qū)
l list known partition types
m print this menu
n add a new partition 創(chuàng)建一個新的分區(qū)
o create a new empty DOS partition table
p print the partition table 打印分區(qū)表
q quit without saving changes 退出不保存
s create a new empty Sun disklabel
t change a partition\'s system id 改變分區(qū)類型
u change display/entry units 改變顯示/輸入的單位
v verify the partition table 驗證這個分區(qū)表
w write table to disk and exit 保存退出
x extra functionality (experts only)
Command (m for help): d #刪除分區(qū)
Partition number (1-8): 2
Command (m for help): p # 打印分區(qū)表
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 #建立新分區(qū)
Command action
l logical (5 or over)
p primary partition (1-4)
p #主分區(qū)
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): 輸入分區(qū)大小 比如100G
Using default value 7649
Command (m for help):
命令: print [devices|free|list,all|NUMBER] :使用 print 命令可以查看分區(qū)表信息,包括硬盤參數,硬盤大小,扇區(qū)大小,分區(qū)表類型和分區(qū)信息。
結果如下:
可以看到 sdb 硬盤大小是21,5GB,文件系統(tǒng)是 msdos ( msdos 文件系統(tǒng)是windows下的文件系統(tǒng),在 parted 命令交互中就是表示MBR分區(qū)表)。
把硬盤由MBR分區(qū)表,改成GPT分區(qū)表,使用的命令如下:
mklabel,mktable LABEL-TYPE :創(chuàng)建新的磁盤卷標(分區(qū)表)。
(如果要由GPT分區(qū)表改成MBR分區(qū)表,命令為 mklabel msdos )
我們在查看一下當前硬盤分區(qū)表情況
可以看到分區(qū)表已經變成GPT分區(qū)表,并且之前硬盤的分區(qū)信息已經沒有了。
之后 quit 退出 parted 命令交互,執(zhí)行 reboot 命令重啟計算機。
重啟完計算機才能執(zhí)行之后的操作。(不重啟后續(xù)操作是無法完成的)
因為修改過了分區(qū)表,所以 /dev/sdb 硬盤中的所有數據都消失了,所以我們可以重新對這塊硬盤分區(qū)了。
執(zhí)行 parted 命令,進入硬盤分區(qū)。
執(zhí)行分區(qū)命令,對硬盤進行分區(qū),命令如下:
mkpart PART-TYPE [FS-TYPE] START END :創(chuàng)建一個分區(qū)。
查看硬盤的分區(qū)情況
已顯示剛剛創(chuàng)建好的分區(qū)disk1。因為沒有格式化,所以 File system:文件系統(tǒng)類型 是空著的。
分區(qū)分完了,我們還需要對分區(qū)進行格式化。不過我們已經知道如果使用 parted 交互命令格式化的話,只能格式化成 ext2 文件系統(tǒng)。我們這里是要演示下 parted 命令的格式化方法。
parted 交互命令的格式化命令為 mkfs ,命令如下:
mkfs NUMBER FS-TYPE :在分區(qū)上建立文件系統(tǒng)。
再查看硬盤的分區(qū)情況
退出
上圖提示你,如果需要讓分區(qū)自動掛載,需要手動修改 etc/fstab 文件。
如果要把硬盤格式化成 ext4 文件系統(tǒng),需要執(zhí)行 mkfs 命令,重新對硬盤進行格式化。(注意不是 parted 交互命令中的 mkfs 命令,而是系統(tǒng)命令 mkfs )!
執(zhí)行 [root@localhost ~] # mkfs -t ext4 /dev/sdb1
將 sdb1 分區(qū)格式化為 ext4 文件系統(tǒng)之后,就可以進行分區(qū)的掛載了。如下圖:
如果你需要開機自動掛載,手動修改 etc/fstab 文件即可。
parted 命令還有一大優(yōu)勢,就是可以調整分區(qū)的大小(windows中也可以實現,不過需要轉換成動態(tài)磁盤,要不就需要依賴第三方工具,如硬盤分區(qū)魔術師)。起始Linux中LVM和RAID是可以支持分區(qū)調整的,不過這兩種方法也可以看成是動態(tài)磁盤方法。使用 parted 命令調整分區(qū)大小要更加簡單。
刪除分區(qū)前提,要先把分區(qū)的自動掛載在 /etc/fstab 文件刪除,然后用 umount 卸載掉分區(qū)的掛載。在執(zhí)行 parted 命令的刪除分區(qū)命令。
rm NUMBER :刪除分區(qū)。
分享名稱:linux命令行刪除分區(qū) linux怎樣刪除分區(qū)
鏈接地址:http://chinadenli.net/article24/hehoje.html
成都網站建設公司_創(chuàng)新互聯,為您提供全網營銷推廣、App開發(fā)、關鍵詞優(yōu)化、、定制網站、域名注冊
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯