1

I'm trying to partition my hard drive on Ubuntu 14.04 - I installed the OS about a week ago and wanted to go ahead and get a dual boot OS of Windows 7. I was looking to partition the hard drive but just was looking for some guidance on using fdisk/gparted because I don't quite understand what disk space would be safe to partition. Here is some relevant output from pydf:

Filesystem           Size Used Avail Use%              Mounted on
/dev/ubuntu--vg/root 216G  11G  194G  5.3 [#.........] /         
/dev/sda1            235M  84M  139M 35.6 [####......] /boot 

So it would seem that I should only not touch sda1 since it's booted, right? And then, I'm really not sure why this output doesn't correspond to fdisk's output here:

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   468860927   234179585    5  Extended
/dev/sda5          501760   468860927   234179584   83  Linux

How is sda2 and sda5 represented in terms of usage? Also, sda1 seems to compose most of my hard drive in terms of fdisk I think? (240GB SSD) Yet, sda2 and sda5 seem to be orders of magnitude larger? I would very much appreciate some help with this.

EDIT:

NAME                           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                              8:0    0 223.6G  0 disk  
├─sda1                           8:1    0   243M  0 part  /boot
├─sda2                           8:2    0     1K  0 part  
└─sda5                           8:5    0 223.3G  0 part  
  └─sda5_crypt (dm-0)          252:0    0 223.3G  0 crypt 
    ├─ubuntu--vg-root (dm-1)   252:1    0 219.9G  0 lvm   /
    └─ubuntu--vg-swap_1 (dm-2) 252:2    0   3.5G  0 lvm   [SWAP]
sr0                             11:0    1  1024M  0 rom   
lionbakerman@lionbakerman-NV55S:~$ sudo df
Filesystem                  1K-blocks     Used Available Use% Mounted on
/dev/mapper/ubuntu--vg-root 226778500 14420008 200815760   7% /
none                                4        0         4   0% /sys/fs/cgroup
udev                          1739680        8   1739672   1% /dev
tmpfs                          351080     1316    349764   1% /run
none                             5120        0      5120   0% /run/lock
none                          1755384      140   1755244   1% /run/shm
none                           102400       52    102348   1% /run/user
/dev/sda1                      240972    85822    142709  38% /boot
3
  • use Gparted and see if the result is the same
    – Virusboy
    Dec 6, 2014 at 17:52
  • The thing is fdisk shows the output in 1K blocks based on the partitions of the disk, on the other hand df shows the output based on all mounted FS along with the pseudo FSs. So you should try something like sudo lsblk that will show the output considering both the partitions and mounting.
    – heemayl
    Dec 6, 2014 at 20:30
  • Added some output from what you mentioned. I'm still unsure which partition space is safe to repartitionl
    – Reasonable
    Dec 7, 2014 at 0:06

1 Answer 1

0

You're going to install a Microsoft OS... Any Microsoft OS must be installed on the first primary partition of the hard drive and that partition must be made bootable. (that's what you get from a monopoly: you can dictate what you want and it has been like this since MS-DOS 1.0)

So basically, you've backed yourself into a corner as the first primary partition (sda1) is a Linux partition (ext4 probably, not visible from the output you've provided) and Microsoft will not like that... To complicate things further, you have no spare partitions and your extended partition (sda2) only contains one partition (sda5) containing all of Ubuntu (system and data but not the boot) which is fully encrypted (which nor Microsoft nor the Ubuntu Live CD like either).

The easiest for you to do is buy an additional hard drive, set that as the primary hard drive in your BIOS and install Windows on there. To switch to Ubuntu, you'll have to go into the BIOS and boot from your secondary hard drive. (Windows cannot be booted from a secondary hard drive)

The more complicated solution is to unencrypt sda5, back up your entire hard drive using something like CloneZilla Disk-to-image, boot Windows from CD, wipe all partitions using the Windows boot loader, create whatever Windows partitions you want and then boot with the Ubuntu Live CD you used for installing your OS a week ago, install it again using the same partitioning scheme you used a week ago (minus the space you allocated to Windows).

You now have a grub2 system allowing you to boot into both OSes.

Only now can you restore the images from your backup into the newly created Linux partitions effectively restoring your work of the entire week...

These new partitions will have different partition numbers though so the sda1 of your backup will have to be restored in sda2 or sda3 or so depending on your new install and sda5 into whatever first partition of your extended partition you now have created...

Now you're finally ready to reboot and boot into your restored Ubuntu partitions from a week ago. The only thing left now is to re-encrypt your non-boot Ubuntu partition...

There is an even smarter solution that I can see but that is the really complicated solution so drop a comment if you're interested in that one! (No, no additional HD necessary)

2
  • 1
    I guess I'm going with the complicated solution. The only real reason I even wanted to install Windows was to facilitate a temporary transition process to Ubuntu. Probably not worth buying another HDD. Furthermore, it's a laptop and I couldn't even put the second hard drive inside I don't think.
    – Reasonable
    Dec 8, 2014 at 0:40
  • Ubuntu can boot from an external HDD... Do you need more detail? Or is this answer good enough? If yes, please accept it...
    – Fabby
    Dec 8, 2014 at 0:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .