Linux - Hardware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-28-2010, 12:44 PM
|
#1
|
|
Member
Registered: Mar 2008
Location: Here - Where else?
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?
|
|
|
|
03-28-2010, 02:02 PM
|
#2
|
|
Member
Registered: Jan 2008
Location: Poland
Distribution: Slackware, Arch
Posts: 38
Rep:
|
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.
|
|
|
|
03-28-2010, 02:47 PM
|
#3
|
|
Member
Registered: Mar 2008
Location: Here - Where else?
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":
Code:
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start= 1, size= 931769, Id=83, bootable
/dev/sda2 : start= 931770, size= 8353800, Id=82
/dev/sda3 : start= 9285570, size= 30732345, Id=83
/dev/sda4 : start= 40017915, size=488295675, Id=83
Thank you so much for your help so far.
If you have the time, please tell me what to do step by step like I'm a 6 year old.
(This is sort of pathetic -- A fellow installs Gentoo Linux from stage 3 by chrooting from a puppy cd, but cannot partition a hard drive -.-)
|
|
|
|
03-28-2010, 05:10 PM
|
#4
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,230
|
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.
Do all the above from a liveCD.
|
|
|
|
03-28-2010, 05:37 PM
|
#5
|
|
Member
Registered: Jan 2008
Location: Poland
Distribution: Slackware, Arch
Posts: 38
Rep:
|
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.
|
|
|
|
03-28-2010, 09:00 PM
|
#6
|
|
Member
Registered: Mar 2008
Location: Here - Where else?
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?
|
|
|
|
03-29-2010, 12:50 PM
|
#7
|
|
Member
Registered: Jan 2008
Location: Poland
Distribution: Slackware, Arch
Posts: 38
Rep:
|
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, ... 
|
|
|
|
04-02-2010, 02:00 PM
|
#8
|
|
Member
Registered: Mar 2008
Location: Here - Where else?
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.
|
|
|
|
04-02-2010, 02:06 PM
|
#9
|
|
Senior Member
Registered: Dec 2007
Distribution: Mepis, Centos
Posts: 4,679
|
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.
Last edited by johnsfine; 04-02-2010 at 02:08 PM.
|
|
|
|
04-04-2010, 03:15 PM
|
#10
|
|
Member
Registered: Mar 2008
Location: Here - Where else?
Distribution: Fedora 12, Arch Linux (updated daily =D)
Posts: 270
Original Poster
Rep:
|
I'll go with deleting swap. Sounds simplest. 2 GB of RAM ought to be plenty. I can use a logical volume as swap, correct?
|
|
|
|
04-04-2010, 04:31 PM
|
#11
|
|
Senior Member
Registered: Dec 2007
Distribution: Mepis, Centos
Posts: 4,679
|
Quote:
Originally Posted by chickenlinux
I can use a logical volume as swap, correct?
|
Correct.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:23 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|