1
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            1985    23975935    11986975+   f  W95 Ext'd (LBA)
/dev/sdb2   *    23975936    24180734      102399+   7  HPFS/NTFS/exFAT
/dev/sdb3        24180736   233895934   104857599+   7  HPFS/NTFS/exFAT
/dev/sdb4       233895936  1250263039   508183552    7  HPFS/NTFS/exFAT
/dev/sdb5            2048    23975935    11986944    1  FAT12

The extended partition contains some recovery tools. Partition sdb3 has Windows 8 installed on it. Partition sdb4 has some random data (Videos, Music etc).

Is it possible to install Ubuntu on sdb4 such that the data on it can be accessed on both Windows as well as Linux ? Or any other way without deleting the recovery partition ?

Thanks!

Shubham
  • 113
  • 5
  • Similar to http://askubuntu.com/questions/149821/my-laptop-already-has-4-primary-partitions-how-can-i-install-ubuntu – RPiAwesomeness Sep 03 '13 at 13:59
  • I did refer to this question before posting my own. As I specified earlier, I do not wish to delete the recovery partition (as suggested in the marked answer). So my question is not really similar to that one. The second answer there suggests formatting the other partition to ext4. This is why I asked another question because I'm not sure whether I will be able to access the data on both Windows and Ubuntu then. – Shubham Sep 03 '13 at 14:10
  • True, my bad. I was just posting it as it was similar. – RPiAwesomeness Sep 03 '13 at 14:27

2 Answers2

1

What you've got is this:

extended partition holding one logical partition
primary partition
primary partition
primary partition where you want to install Linux

This is a rather awkward configuration. The problem is that you've maxed out your primary partition table, so you can't create another primary (or extended) partition; and to create additional logical partitions, you'd need to move and/or resize all three of your primary partitions.

This can be worked around in various ways. Here's what I recommend:

  1. Back up all your important data. (You should have such a backup already.)
  2. Using a Windows partitioning tool, Shrink /dev/sdb4 so that there's free space at the end of the partition sufficient to install Linux.
  3. Download my FixParts program. You can use the Windows version or use a Linux emergency disc that contains it. IIRC, Parted Magic comes with FixParts.
  4. Using FixParts, use the r option to convert /dev/sdb5 into a primary partition.
  5. Use the l option to convert /dev/sdb4 into a logical partition.
  6. Type s to sort the partitions. This will ensure that they're in on-disk order, which will be less confusing than if they're not.
  7. Type p to view the partition table and verify that they're all present. (Note that FixParts doesn't display extended partitions, though, so don't be concerned when you don't see one.)
  8. If all is well, type w to save your changes.
  9. If necessary, reboot into Linux.
  10. Launch GParted and use it to expand the extended partition, which should now be at the end of the disk, covering what was originally /dev/sdb4 (and will now be /dev/sdb5), to cover the free space at the end of the disk.
  11. Install Ubuntu. It should create new logical partition(s) at the end of the disk.
Rod Smith
  • 44,284
  • 7
  • 63
  • 105
0

You can't just install on a partition that has data on it ... what I would be inclined to do is use a windows resizing tool for the partition (such as Paragon HDD Manager), which can resize that partition so that it has just enough space for what is on it that you want to save, and then convert the rest into free space ... and then you could attempt a Linux install into that free space (using the partition tools on the install disk - manually partition it).

... so short answer is No ... not without preliminary work to resize that partition & create a new space for Linux to go ... hopefully you will have no problems turning that space into a 4th primary or 2nd extended partition

If there is nothing particularly important on the following FAT32 partition ... perhaps delete it also, and turn all the free space after resizing the preceding drive into a Volume Group, and then you can create multiple logical volumes inside that ... using them for the Linux install, and as share partitions

  • could you clarify which is the recovery partition?
Mr.President
  • 359
  • 1
  • 3
  • 12
  • sdb1 is the extended partition, in which sdb5 is the recovery partition. – Shubham Sep 03 '13 at 14:15
  • Is it possible to have a second extended partition ? – Shubham Sep 03 '13 at 14:17
  • you can have 4 primaries on the one drive, your question title says you have 3 ... do you in fact have 4 already? – Mr.President Sep 03 '13 at 14:18
  • Either way ... you can't do it without resizing what is there to free up some space in which to make a new partition ... and as far as I know yes you can make another extended – Mr.President Sep 03 '13 at 14:20
  • If I format the sdb4 partition to ext4 and install Ubuntu on this partition, will I be able to access its data in Windows ? – Shubham Sep 03 '13 at 14:23
  • You seem to have missed my previous comment ... NO DO NOT DO THIS ... you will lose your data if you have data on that partition.

    What you need to do instead, is to RESIZE that partition FIRST ... and only then can you free up some space in which to make partitions / logical volumes in which to install Linux ... if you format sdb4 your data is GONE, so do not do this ... you really have only 2 options: A - resize the partition (sdb4), or B - save that data to DVD or elsewhere, and THEN you can format it (having backed it up to another location) ... clear?

    – Mr.President Sep 03 '13 at 14:48
  • Shubham already has four primaries (three primaries and one extended), so no new primary partitions can be created. Some juggling is required to overcome this problem; see my answer. – Rod Smith Sep 03 '13 at 15:50