[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Deleting partitions
From: |
Chris Jones |
Subject: |
Deleting partitions |
Date: |
Sat, 07 Apr 2012 00:56:35 -0400 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
This is not a grub question per se but I'm not sure where else I could
find _reliable_ information about this.¹
I am in the process of spring-cleaning my laptop's hard drives and would
like to delete a couple of partitions.
Here is the (partial) output of fdisk -l:
| Disk /dev/sdb: 320.1 GB, 320072933376 bytes
| 255 heads, 63 sectors/track, 38913 cylinders
|
| [..]
|
| Disk /dev/sda: 320.1 GB, 320072933376 bytes
| 255 heads, 63 sectors/track, 38913 cylinders
| Units = cylinders of 16065 * 512 = 8225280 bytes
| Sector size (logical/physical): 512 bytes / 512 bytes
| I/O size (minimum/optimal): 512 bytes / 512 bytes
| Disk identifier: 0x8f49dca2
|
| Device Boot Start End Blocks Id System
| /dev/sda1 * 1 223 1782784 7 HPFS/NTFS
| Partition 1 does not end on cylinder boundary.
| /dev/sda2 223 7435 57936884 7 HPFS/NTFS
| /dev/sda3 35854 38914 24576344 7 HPFS/NTFS
| /dev/sda4 7435 33385 208437249 5 Extended
| /dev/sda5 21713 24145 19530752 83 Linux
| /dev/sda6 24145 26090 15624192 82 Linux swap / Solaris
| /dev/sda7 26090 28522 19529728 83 Linux
| /dev/sda8 28522 33385 39061504 83 Linux
| /dev/sda9 7435 11934 36132864 83 Linux
|
| Partition table entries are not in disk order
The partitions that I want to delete are /dev/sda5 and /dev/sda8.
My /boot/grub directory is in the /dev/sda9 partition and if I boot off
of a live CD and delete the /dev/sda5 and /dev/sda8 partitions, the
current /dev/sda6, /dev/sda8 and /dev/sda9 will automatically be
renumbered and become /dev/sda5, /dev/sda6, and /dev/sda7 (msdos5,
msdos6, and msdos7).
As a result, if I proceed to reboot off of the hard drive, the grub boot
loader environement will fail to initialize because it will look for the
/boot/grub/ directory in the /dev/sda9 (msdos9) partition, which no
longer exists.²
Rather than go through the hassle of repairing a broken boot loader
manually from the grub rescue prompt (or worse do a grub-install
--root-directory= of a possibly incompatible version of grub from
a repair CD), is there a better strategy³..?
Would chroot'ing to the linux system on /dev/sda9 (now /dev/sda7)
immediately after deleting the two partitions and running update-grub
(and OS-prober) from the chroot be the best choice..?
Is there another, perhaps more elegant, solution..?
Thanks,
CJ
¹ Obviously, a detailed/reliable manual, wiki, howto.. that describes
such scenarios would be fine, but I haven't been able to find one.
² /etc/fstab's should be OK since I use UUID='s everywhere.
³ Simple use case, the only complication being that there are two hard
drives in this laptop - but no encryption, no lvm, no raid.. etc.
- Deleting partitions,
Chris Jones <=