Linux磁碟分割(二):刪除,linux磁碟分割刪除

來源:互聯網
上載者:User

Linux磁碟分割(二):刪除,linux磁碟分割刪除

***********************************************聲明************************************************ 

原創作品,出自 “深藍的blog” 部落格,歡迎轉載,轉載時請務必註明出處(http://blog.csdn.net/huangyanlong)。

表述有錯誤之處,請您留言或郵件(hyldba@163.com)指明,不勝感激。

*****************************************************************************************************

續接上篇:“舉例:將sdb1格式化為ext3檔案系統”點擊開啟連結

*****************************************************************************************************
Linux硬碟分區(二):刪除

*****************************************************************************************************


*************************
舉例:對sdb1進行umount

*************************

[root@hyl /]# df -hFilesystem            Size  Used Avail Use% Mounted on/dev/sda1             9.7G  5.4G  3.9G  59% //dev/sda3              35G   17G   17G  50% /hometmpfs                1006M     0 1006M   0% /dev/shm/dev/sdb1             1.9G   35M  1.8G   2% /data1[root@hyl /]# umount /data1[root@hyl /]# df -hFilesystem            Size  Used Avail Use% Mounted on/dev/sda1             9.7G  5.4G  3.9G  59% //dev/sda3              35G   17G   17G  50% /hometmpfs                1006M     0 1006M   0% /dev/shm[root@hyl /]# fdisk -lDisk /dev/sda: 53.6 GB, 53687091200 bytes255 heads, 63 sectors/track, 6527 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1        1305    10482381   83  Linux/dev/sda2            1306        1827     4192965   82  Linux swap / Solaris/dev/sda3            1828        6527    37752750   83  LinuxDisk /dev/sdb: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb1               1         250     2008093+  83  Linux/dev/sdb2             251         500     2008125   83  Linux/dev/sdb3             501         750     2008125   83  Linux/dev/sdb4             751        1305     4458037+   5  Extended/dev/sdb5             751         875     1004031   83  Linux/dev/sdb6             876        1000     1004031   83  Linux/dev/sdb7            1001        1305     2449881   83  Linux
*************************
對第二塊磁碟操作(即/dev/sdb)
*************************
[root@hyl /]# fdisk /dev/sdbThe number of cylinders for this disk is set to 1305.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): mCommand 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): pDisk /dev/sdb: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb1               1         250     2008093+  83  Linux/dev/sdb2             251         500     2008125   83  Linux/dev/sdb3             501         750     2008125   83  Linux/dev/sdb4             751        1305     4458037+   5  Extended/dev/sdb5             751         875     1004031   83  Linux/dev/sdb6             876        1000     1004031   83  Linux/dev/sdb7            1001        1305     2449881   83  Linux</span>
*************************
刪除分區:sdb1及其它
*************************

Command (m for help): d--輸入刪除指令Partition number (1-7): 1--輸入刪除的分區號Command (m for help): p--列印分區表Disk /dev/sdb: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb2             251         500     2008125   83  Linux/dev/sdb3             501         750     2008125   83  Linux/dev/sdb4             751        1305     4458037+   5  Extended/dev/sdb5             751         875     1004031   83  Linux/dev/sdb6             876        1000     1004031   83  Linux/dev/sdb7            1001        1305     2449881   83  Linux--可以看到sdb1已經被刪除了--接下來同理,刪除其它分區Command (m for help): dPartition number (1-7): 2Command (m for help): dPartition number (1-7): 3Command (m for help): dPartition number (1-7): 4Command (m for help): p Disk /dev/sdb: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  SystemCommand (m for help): w--儲存退出The partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.--現在可以移除磁碟了

***********************************************聲明************************************************ 

原創作品,出自 “深藍的blog” 部落格,歡迎轉載,轉載時請務必註明出處(http://blog.csdn.net/huangyanlong)。

表述有錯誤之處,請您留言或郵件(hyldba@163.com)指明,不勝感激。

*****************************************************************************************************



linux的分區被誤刪了,開機進入不了系統

電腦是XP和AS4的雙系統,用AS4的GRUB引導,昨天在XP下誤刪了1G的SWAP分區,導致開機進入GRUB命令提示字元,用命令可以進入XP,用分區工具重新建立SWAP分區後還是無法進入Linux。難倒要重裝Linux?這種情況下應該是你的開機磁碟分割在swap之後,造成swap被刪後,分區id改變 。 你可以在grub shell下重新指定開機磁碟分割。
假如linux安裝分區/dev/hda6
你輸入 root (hd0, grubinstall重裝下grub swap 刪了,應該跟grub 沒什麼關係吧!我是這樣想的!用livecd 進去後,修改 /etc/fstab檔案應該就可以了!我是菜鳥,不要見笑! grubinstall重裝下grub
後按tab鍵,就可以看到當前的分區資訊,根據列出的分區資訊補上你現在實際根分區id就可以
 
為何第二次安裝linux時找不到硬碟分區

分區表損壞了?

這個重複用多個分區軟體分區很容易出現這個問題。解決辦法不知道。有人用 PQ 修複就好了。有人用 PQ 修複後硬碟資料丟失。
有人用 disk man (忘了改名後他叫什麼了)重建立立分區表才好。
有人僅僅是修改了一下分區就又好了。

所以,怎麼解決全憑運氣,建議先找個軟體備份一下分區表後在做嘗試。

關於你的 PS :1、系統是拿來用的,不是用來裝的;2、光碟機是拿來用的,不是用來擺著的;3、速度還是很快的,慢的是解壓縮過程,而且方便,方便的好處就是減少的其他動作的浪費實際;4、你的光碟機該換新了……
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.