Convert primary to logical linux

Convert primary partition to logical partition in linux

I have created new partition through Gparted in linux mint and now have used up all 4 primary partitions. Gparted directly created primary partition, the logical option was disabled. So I cannot create any more partitions even though there is lot of free space on my disk. How can I convert the data partition(non system related) to a logical partition, so that it frees up a primary one? I would prefer a Linux solution, since I have recently switched to Mint 19.1 from Windows 10 though it is still present as dual boot. Output of sfdisk:

sudo sfdisk -d /dev/sda label: dos label-id: 0xfc515ad7 device: /dev/sda unit: sectors /dev/sda1 : start= 2048, size= 1124352, type=7, bootable /dev/sda2 : start= 1126400, size= 408475648, type=7 /dev/sda3 : start= 409602048, size= 1000001528, type=f /dev/sda4 : start= 1409605632, size= 40960000, type=83 /dev/sda5 : start= 409602056, size= 409599984, type=7 /dev/sda6 : start= 819204096, size= 78123008, type=83 /dev/sda7 : start= 897329152, size= 9762816, type=82 /dev/sda8 : start= 907094016, size= 195309568, type=83 /dev/sda9 : start= 1102403592, size= 307199984, type=7 

add the output of sfdisk -d /dev/sda to your question (replace /dev/sda with the disk you want to repartition, if that’s not it). Depending on how tight the partition table is, this may not be possible without moving data around.

1 Answer 1

The partitions are spaced well enough, and you could transform the primary partitition sda4 into a logical one sda10 , if you first resize the extended partition sda3 .

However I strongly advice you to first try it on a dummy file that you could create with

 $ dd if=/dev/null of=/tmp/dummy bs=1 seek=1000G $ sfdisk /tmp/dummy < new_partition 

The last step will let the kernel attach a loop device ( /dev/loop0 if it isn't already in use) to /tmp/dummy and scan all the partitions that you have created on it. Then you could check with partitioning tools like fdisk or gparted if they're able to parse the partitioning of /dev/loop0 fine. Only after all that proceed with the

You should also change any references to sda4 to sda10 (and (hd0,msdos4) to (hd0,msdos10) ) in /etc/fstab and /etc/grub.d/* (the latter followed by an update-grub ).

By all means, do not accuse me of anything if you're hosing your system 😉

It may be better to wait for another answer, there are probably automated tools that could convert your partition table to GPT or such things, or more friendly partitioning programs that let you do it in a guided way.

new_partition:

/dev/sda1 : start= 2048, size= 1124352, type=7, bootable /dev/sda2 : start= 1126400, size= 408475648, type=7 /dev/sda3 : start= 409602048, size= 1040963584, type=f /dev/sda5 : start= 409602056, size= 409599984, type=7 /dev/sda6 : start= 819204096, size= 78123008, type=83 /dev/sda7 : start= 897329152, size= 9762816, type=82 /dev/sda8 : start= 907094016, size= 195309568, type=83 /dev/sda9 : start= 1102403592, size= 307199984, type=7 /dev/sda10 : start= 1409605632, size= 40960000, type=83 
@@ -1,9 +1,9 @@ /dev/sda1 : start= 2048, size= 1124352, type=7, bootable /dev/sda2 : start= 1126400, size= 408475648, type=7 -/dev/sda3 : start= 409602048, size= 1000001528, type=f -/dev/sda4 : start= 1409605632, size= 40960000, type=83 +/dev/sda3 : start= 409602048, size= 1040963584, type=f /dev/sda5 : start= 409602056, size= 409599984, type=7 /dev/sda6 : start= 819204096, size= 78123008, type=83 /dev/sda7 : start= 897329152, size= 9762816, type=82 /dev/sda8 : start= 907094016, size= 195309568, type=83 /dev/sda9 : start= 1102403592, size= 307199984, type=7 +/dev/sda10 : start= 1409605632, size= 40960000, type=83 

Источник

Читайте также:  Linux list all network interfaces

Converting Primary to Logical Partitions

I am dual booting Ubuntu on Windows 8, and during the install, I get no option to install alongside Windows 8. A previous question gave me the information that I needed to make my partitioned drive for Ubuntu a logical drive before it can be used in Ubuntu. The person who answered gave me a link to a program that you had to pay for. Is there any way that I can change my primary partition to a logical partition without paying for a software? I am stuck on this final step in installing Ubuntu!! Please be specific, I am new to Linux based software.

Could you boot using live CD, run sudo fdisk -l in terminal, then post its output. This will help to get answers.

Did you install Windows 8 in BIOS with MBR partitioning? Or is it pre-installed? If pre-installed you have gpt partitioning and gpt does not have primary nor logical. Just one type that is in effect primary but not limited to 4 prmary like MBR(msdos). Post this. sudo parted -l

3 Answers 3

You need to make some free space out of Windows 8 for Linux.

For this, in Windows 8, go to Disk Management tool .

In the Disk Management tool:

Right click on the drive and select shrink volume .

You must leave the free space.

Now, you go to Control Panel ---- Hardware and Sound --- Power Options --- System Settings --- Choose what the power buttons do --- Uncheck the Turn on fast startup box.

You will have to choose boot from USB option from within Windows itself, pressing shift key while clicking on Restart .

Reboot and in Bios options, You must disable: Secure boot in UEFI.

Plug in the USB, the Ubuntu Live USB and boot the system from it.

Once you have booted, you will be presented with option to try or install Ubuntu. Click on install.

In Installation Type . Choose Something else .

You shall use the free space to create Root / , Swap, and Home /home , partitions.

Select the free space and click on the + sign.

Читайте также:  Reducing linux file system

Once you are ready with Root, Swap and Home, click on Install Now

Источник

How to change ext4 primary partition to logical

Partitions

This is how my partitions look like. They were created in a very lame way I admit:) My primary goal here is to be able to have another primary partition for 3rd OS but for this I need to do something as I unwisely created /home partition as primary. Most likely I will remove and re-create swap and windows partitions (reinstalling windows). So the only way how to achieve this is for me to somehow change sda2 partition to logical. I don't mind doing anything except reinstalling Linux on sda1 and losing data on `sda2. What are my options here? Is it for example possible to remove everything except sda1 and sda2 then somehow clone sda2 to the new logical partition of newly created extented partition?

Are you sure you need an extended partition? The laptop I am using here has 9 partitions, none extended. It came with 7 partitions, courtesy of W8, and I found no difficulty using parted to add two more for Ubuntu and Swap.

@AFH you are likely using GPT partitioning. The above is MSDOS partitioning, so only supports four primary partitions.

@Paul - you may well be right: I have never needed to investigate on this machine. In which case LeNoob needs either to convert to GPT (if each OS supports it) or to save a partition by using a swap file instead of a swap partition (unless there is a need to hibernate): /dev/sda4 can be moved to the end of the disc, and /dev/sda3 can then be recreated to fill all the available space.

3 Answers 3

You can convert primary to logical and vice-versa using my FixParts program. Many Linux distributions provide it in the gdisk or gptfdisk package; the command name is fixparts . There are some caveats, though; namely, you need to have at least one free (unallocated) sector immediately preceding every to-be-logical partition. It's unclear if you've got such a free sector before your current /dev/sda2 . If not, the safest way to create such a gap is to use GParted to shrink /dev/sda1 (that's /dev/sda1 , not /dev/sda2 ) by the smallest amount possible -- probably 1MiB. That will open a gap between /dev/sda1 and /dev/sda2 , which will enable FixParts to convert /dev/sda2 from primary to logical. Note that you'll need to do all of this (or at least the GParted operations) from a live CD; GParted won't let you operate on partitions that are currently mounted, as /dev/sda1 must be if you boot from it.

You have room to move /home back into root.

sudo mkdir /home2 sudo rsync -ax /home/ /home2/ sudo umount /home (you'll need to boot as single user to do this) sudo rmdir /home sudo mv /home2 /home 

Then edit /etc/fstab so that it doesn't mount /home

Читайте также:  Linux intellij idea android

Then you can delete /dev/sda2 and re-create it as an extended partition. Note that if the third OS is linux or similar, it doesn't need to be in a primary partition. Grub can boot it from a logical.

Источник

Re: Какой тулзой превратить primary в logical partition?

Спасибо. Буду делать второй подход к Ubuntu. Теперь уже с гномом (xubuntu ИМХО фигня).

Re: Какой тулзой превратить primary в logical partition?

А чего мешает сделать apt-get install ubuntu-desktop ?

Re: Какой тулзой превратить primary в logical partition?

Disk /dev/hda: 60.0 GB, 60011642880 bytes 255 heads, 63 sectors/track, 7296 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System /dev/hda1 1 13 104391 83 Linux /dev/hda2 * 14 3749 30009420 7 HPFS/NTFS /dev/hda3 3750 3872 987997+ 82 Linux swap / Solaris /dev/hda4 3873 7296 27503280 83 Linux

Генту не хочу сносить. Она у меня основная ОС.

Похожие темы

  • Форум FreeBSD + logical partitions (2002)
  • Форум Перенос раздела logical->primary (2015)
  • Форум Cirrus Logic (2002)
  • Форум enlarged logical partitions overlap (2009)
  • Форум primary partition in linux (2007)
  • Форум Partition table (2004)
  • Форум Посоветуйте тулзу для рисования блок-схем (2006)
  • Форум Resize ext2-partition (1999)
  • Форум Ubuntu parted: Too many primary partitions (2014)
  • Форум OpenBSD in extended partition (2004)

Источник

Перенос раздела диска из primary в logical

На машине установлен Open Suse и для него на диске выделены 3 основных раздела ( из возможных 4 в секторе MBR ) под OS,swap, home.Хотелось бы иметь возможность ставить дополнительные OS.Можно ли перенести swap и home в логический раздел, освободив основные ?

gdisk (gptfdisk) — может без потерь — сконвертировать тебе MBR в GPT ..

после этого проблемы с primary и logical — пропадут

(но незабудь загрузчик обновить!)

user_id_68054 ★★★★★ ( 21.04.15 21:18:52 MSK )
Последнее исправление: user_id_68054 21.04.15 21:19:05 MSK (всего исправлений: 1)

gdisk должен запускаться с Linux live CD или необязательно ? что значит обновить загрузчик ? Как это сделать ? Будет ли это работать с BIOS'ом (не UEFI) ?

Будет ли это работать с BIOS'ом (не UEFI)

но для этого придётся сделать дополнительный малюсенький раздел («ef02 BIOS boot partition»)

grub (точнее: grub-install) — автоматически найдёт этот раздел (если он существует.. иначе — покажет ошибку)

gdisk должен запускаться с Linux live CD или необязательно ?

наверно лучше с LiveCD .. конвертнуть можно и без LiveCD , но после конвертирования (если без LiveCD) ядро не узнает об этом до перезагрузки (а перезагрузка не сможет корректно произойти если не обновить загрузчик. а загрузчик врядли получится обновить до момента пока ядро владеет устаревшей информацией о разделах)

после того как конвертируешь разделы MBR->GPT и создашь новый раздел «ef02 BIOS boot partition».

. сделай chroot в корневой раздел твоей установленной системы (подключи там /proc/ и /dev/ ), и после этого просто сделай

(но проследи обязательно чтобы LiveCD загружался бы НЕ в UEFI-режиме)

Источник

Оцените статью
Adblock
detector