[lfs-support] help, i hosed my windows partition

Pierre Labastie pierre.labastie at neuf.fr
Sun Mar 10 03:47:43 PDT 2013

Le 10/03/2013 10:33, tilmanbregler a écrit :
> Hi,
> so this is a bit emberassing, and I appreciate if you say this is
> nothing to do with you. I have this dual boot Ubuntu 12.04/Windows 7
> setup. And to make room for th LFS partitions i decided to shrink the
> Windows 7 partition.
> [...]
>   This is how my
> partition table looks, atm:
>   sudo fdisk -l
> Disk /dev/sda: 750.2 GB, 750156374016 bytes
> 255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 4096 bytes
> I/O size (minimum/optimal): 4096 bytes / 4096 bytes
> Disk identifier: 0x05b005af
> Device Boot Start End Blocks Id System
> /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
> /dev/sda3 206848 1465147391 732470272 5 Extended
> /dev/sda5 1024004096 1449783295 212889600 83 Linux
> /dev/sda6 1449785344 1465147391 7681024 82 Linux swap / Solaris
Well, so which is your Ubuntu partition: /dev/sda5?
It seems that there is a NTFS partition at /dev/sda1. What is it?
I thought Windows needed only one partition, but maybe
it is not true.
Anyway, you could try two things:
1) Shrink the first partition by one sector (this involves
shrinking first the filesystem), then remove the extended partition
and recreate it starting at 206847 (this involves removing first
/dev/sda5-6 and recreating them afterwards, at the same sectors of course,
see 2) below for something slightly more detailed).
Then recreate the Windows partition starting at 206848.
2) Remove first the extended partition /dev/sda3. This involves removing
/dev/sda5 and 6, too,
so you might loose your linux systems if something goes wrong.
Of course, keep a track of the sectors of those partitions...
-Create a primary partition (/dev/sda2) for the NTFS system starting at
206848 and with a size enough to contain your Windows system.
-Recreate the extended partition starting just after /dev/sda2
and extending to the end of the disk.
-Recreate logical partitions /dev/sda5 and 6 with the same sectors as 
-Cross fingers and write the table to disk (well, instead
of crossing fingers, think long before you do, print the partition table
and double check everything. As long as you do not
type 'w', you cannot screw things more than they are...)

Remember, all of this may fail for just one typo!

Regards and good luck

More information about the lfs-support mailing list