Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
didnt know you could change a primary partition to an extended without data loss.
Always assume that there is potential for data loss, especially when editing partitions.
Assuming that you have an external hdd available with enough free space, you can easily backup entire partitions using dd. The process is time consuming and great care must be taken to ensure that you have the correct destination path or you will end up over-writing valuable data.
If your external drive is mounted on /media/backup/ for example, your command would look something like this;
/dev/sda1 would be /dev/sdb1 or /dev/sdc1 etc. if you've connected that drive to another PC to work on it. (or booted from a different hdd)
partition1.img can be any file name you choose, but make certain you include a file name or dd will simply over-write the directory.
bs=1M can be bs=1G or bs=3G etc. as long as you have enough free ram to support it.
Note that this can take several hours to complete in some cases and the larger the partition is, the longer it will take.
P.S: it is also not a good idea to try copying a mounted partition as any access to that partition can corrupt the image file you're creating. If you must mount the partition, mount it as read-only.
Could you be so kind to instruct me, how do I rename sdc3 from primary to extended and create inside it a couple of logical partitions without losing my "foo" file?
Ok. I am not a Gentoo user. Programmer. Blah blah blah.
Just a Linux using Scooter Tramp.
I noticed the problem you present me has nothing to do with Windows. But that is OK. I have broad shoulders and can handle that also.
cd. Use your bios key to boot the live cd. Open the partitioner tool. It will look sorta like this old picture
Right click on "foo" . Pick change to logical. Hit apply. When done shut down the cd and computer.
You can do the shrinking and other stuff in Gentoo Gparted.
I did this with Windows. Which is notorious for Data loss and Non bootable after messing with Windows NTFS operating system partition shrinkage. I did not trip or fall. But YMMV. Not being a Linux Knuckle Dragging Scooter Tramp like I am
with a GED edjucation.
Good Luck with it. Happy Trails, Rok
Edit: The only reason I preserve Windows on any of my laptops is I use DRM Windows Motorcycle
Tuning Software that is run once and costs hundreds of dollars.
2nd Edit: Forgot to mention I made my Restore DVDs. All 3 of them. Before carving up that Compaq
Laptop to how I wanted to use it.
Right click on "foo" . Pick change to logical. Hit apply. When done shut down the cd and computer.
There is no any "logical" options. The only change I can aplly to partition is changing filesystem type (Fat, NTFS, ext,OS/2 and so on).
Could you be so kind to explain, what exactly have I to click to change primary partition to extended without having to delete it?
Added:
When I click partition, appears menu with this items: Copy, Set Active, Delete, Format, Resize, Hide/Unhide, Info, List Types, Move, Delete All, Set type, Erase. Which one do you use to change partition "to logical"?
At third partition I created a file named "foo".
Could you be so kind to instruct me, how do I rename sdc3 from primary to extended and create inside it a couple of logical partitions without losing my "foo" file?
Essentially, you don't, at least not without backing up your file elsewhere and restoring it afterward. The existing filesystem in that partition would have to be shifted over slightly to make room the the extended partition header. That's a fussy operation that has to be done exactly right or you lose the filesystem. It's not something I would be very eager to do even though I do, at least in theory, know how.
The existing filesystem in that partition would have to be shifted over slightly to make room the the extended partition header. That's a fussy operation that has to be done exactly right or you lose the filesystem. It's not something I would be very eager to do even though I do, at least in theory, know how.
You cannot create fifth partition, and it doesn't matter do you have free space for it or not. You may shift it to the left and to the right, but you can't create fifth partition, neither primary nor extended.
BTW, Partition Logic recommended by you, can't do it as well: it complains that the partitions table full of partitions when trying to add new one.
You cannot create fifth partition, and it doesn't matter do you have free space for it or not. You may shift it to the left and to the right, but you can't create fifth partition, neither primary nor extended.
BTW, Partition Logic recommended by you, can't do it as well: it complains that the partitions table full of partitions when trying to add new one.
Uh. I said change the name of a primary to logical. Not add new one. Must be a communication issue here.
Look at your screenshot carefully: it has FOUR primary partitions (including extended)
The extended marked as sda2.
Your drive never had five primary partitions (including extended). And partitions enumeration proves it.
LOL
Just take any stick and try it yourself instead of arguing.
May be you know something that unknown for Gparted or Partition Logic developers?
You might enlighten them, how to put fifth partition to the drive and after that delete one ot them...
Well, let it be according to you, I'm tired of explaining.
You cannot create fifth partition, and it doesn't matter do you have free space for it or not. You may shift it to the left and to the right, but you can't create fifth partition, neither primary nor extended.
You would have to delete partition 3, then re-create it as an extended partition. Now you could create logical partitions within your new extended partition. If you had previously shrunk the filesystem and shifted it to the right by exactly the correct amount, it would magically reappear in the first logical partition you created.
Quote:
BTW, Partition Logic recommended by you, can't do it as well: it complains that the partitions table full of partitions when trying to add new one.
I never recommended that. You have me confused with someone else.
^ yeah i do but i am still scared to try it.
@teufel: the situation is an hd with 4 primary partitions with important data on each partition. (for whatever reason we dont have an internet connection or any other disk.) rokytnji proposes a solution where a primary partition can be converted to an extended partition and the important files will be undisturbed.
to me it sounds as complicated as updating the kernel without rebooting <@.
@ rokytnji:
yes, I re-read all the posts again after "communication issue" was mentioned and found that I missed this one: http://www.linuxquestions.org/questi...ml#post5295717
You posted wrong iso. It should be Free Partition Manager: http://www.partitionwizard.com/free-...n-manager.html
I tried it this way:
1. Created 4 primary partitions and put text file at one of them
2. Converted this partition's type from primary to logical.
3. Resized logical partition to get free space
4. Created a couple of logical partitions at freed space
I admit, it works with small file. My file still there, though I do not know how things will go if the partition will contain a lot of files. To get enough free space for new partition it might require to destroy data at converted partition. It is the lack of this method.
And yes, we would not be arguing for so long you posted correct link from the beginning Or at least if you replaced "rename" therm with "convert"
@ schneidz:
I do not know how things will go if you have a lot of important files.
I think they will be lost, if the free space within some of partitions (that planned to be converted) insufficiently to create new partition.
And I do not know how this tool will hadle partition if it highly fragmented. Could it move the files properly? Who knows?
Added:
I would try to unload files from sda2 partition to external drive and convert it to logical.
If right now you have at sda3 enoght free space to fit Fedora there (check it), you should be fine.
You could resize it to get free space for Fedora partition and copy saved files back latter.Even they will not fit, you could move some of saved files to Windows C: drive (sda1), of couse if there are enough free space.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.