Change primary partitions to logical partitions AND migrate their data?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Fedora 12, Arch Linux (updated daily =D)
Posts: 270
Rep:
Change primary partitions to logical partitions AND migrate their data?
I've installed Arch Linux onto my Western Digital SATA drive. I love it, best ever, however, I need the fglrx proprietry driver for better 3-d performace, and decided to create a new partition. I decided to install Linux Mint.
Sadly, in all my noobishness, I forgot about the 4 primary partition limit (oops!) and as I have /, /home, swap, and /boot partitions (all primary) already installed, I have run into a bit of a problem.
I resized my /home partition (almost 500GB) to about 225, and was then told I have over 200GB unusable space.
Is it possible for me to change at least 1 of my primary partitions to logical partitions AND keep all the data intact (AND edit the arch configuration so that it'll still work) so I can install a second linux? I sincerely doubt it, but if there's a way, could someone tell me how?
Hi,
should be painless. Create a partition at the end of the drive, move any data into them and delete or modify opening partitions. This could be done without data movement by editing only the partitions table, but don't recommended if you are out of knowledge. Difficult to say, depends on actually arrangement.
Distribution: Fedora 12, Arch Linux (updated daily =D)
Posts: 270
Original Poster
Rep:
Firstly, thank you very very much. Secondly, I'm not entirely sure how to do this. I feel really stupid, and I hope I'm not wasting your time, but could you walk me through this step by step? I've backed up my data, but I'm still scared to death that I'll screw up really badly; I don't want to lose my system.
Here's a partitioning layout as given by "sudo sfdisk -d /dev/sda > partitions":
Short answer, no.
Delete sda4 (after backup), allocate all free space as an extended partition. Allocate a new logical partition at the beginning of the extended (the extended is just a container for logical partitions). Make this new (logical) partition slightly larger than what sda4 was, just to be safe. With luck you'll be able to mount it as sda5 and use it as if nothing had happened. Else restore your data.
Adjust grub and fstab, and you'll be fixed up.
Yes, but resize sda3 down a little (resize filesystem first) and then create extended sda4 and logical sda5 at the same position as sda4 was before (fdisk -lu /dev/sda shows you). Otherwise the new sda5 will be shifted right, and wouldn't mount.
Distribution: Fedora 12, Arch Linux (updated daily =D)
Posts: 270
Original Poster
Rep:
So, I delete sda4 (muh... worse could happen :P) and then add a new sda4 as a logical volume of sda3, then create sda5 as the new primary that will house my Linux Mint as one big partition? Is that right?
No,
sda4 isn't logical, it is primary like sda1,2,3. Sda4 may be extended with logical sda5,6,7... Some programs doesn't show extended partition, only just logical (sda1, sda2, sda3, sda4 (not shown), sda5, ...). If you have data from sda4 backuped, just delete them, and create extended allocating all free space. Samthink like this: fdisk /dev/sda, d, 4, n, e, 4, Enter, Enter, n, l, ...
Distribution: Fedora 12, Arch Linux (updated daily =D)
Posts: 270
Original Poster
Rep:
But, if I'm only allowed 4 primary partitions, and only primary partitions are bootable, do I delete sda4, create a new _extended_ sda4, & make a logical sda5 for the new OS?
Clearly, I need to brush up on fdisk. I've only been using cfdisk, but it's obviously limited.
Unless you have a suspend to disk pending, you have nothing useful in your swap partition.
Converting a primary to logical would be quite hard, but deleting the swap, moving the other primary partitions and later recreating swap as logical should be easy.
To mess around with the partitions, you need to be booted in a liveCD rather than in any of the partitions you are resizing or moving.
Your liveCD might automatically do a swapon to enable use of the swap partition. In that case you need to use swapoff or equivalent command to disable use of swap before deleting it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.