Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
Is it possible to move a partition from [100GB, 200GB] to [300GB, 400GB] when there are other partitions in [200GB, 300GB]? [m, n] is standard notation for intervals. Gparted seems not to allow it.
[100GB, 200GB] is the space on disk beginning at offset 100GB from absolute sector 0 and ending at offset 200GB, again the offset being relative to the disk beginning. And so on for the other intervals (an interval is a thing of the form [m, n] where m and n are positive integers).
I'll put the question in another form (but I think the first is the clearer one). We have three contiguous spaces: A, B and C. B is occupied by one or more partitions. C is free space and A is occupied by the partition I want to move. And I want to move it to C.
So you just want to move the data from one partition to another? You could try blocklevel copy with dd or use rsync to just copy the files and then delete the source when you've verified copy integrity
Well nobody has answered my question. When I select a partition in gparted and the I tell the program to move it, there appears three boxes where you put some quantity in say MB. The first says 'Free space before', the third Free space after. My conclusion is I can't move as described in post # 1 and 3. Is that right?
There are a few ways to move a partition. You can simply slide the edges if there is free room on each side. You can manually put in numbers if you know the numbers to each.
If there isn't free room on each side you may have to copy to a free area or make room.
And how do I copy data from A? You mean with cp? Well but that would involve a lot of time. The partition editor could simply rewrite the partition table (let's assume it's a primary partition). If it is partition 2 and there are only three partitions then it simply has to copy the 16-byte 2nd entry into an empty entry and that's much faster, isn't it?
If I understand your post, your "renaming" the partition and not physically moving the data. Your data would still be in A,B and C would still be empty.
If the partition is mostly empty, then cp will be the fastest method of copying the data. If the partition is mostly full, dd may be faster (minimized seeks).
The way gparted does stuff, it can't move a partition over an occupied space. It tries to do things in a way which will fail safe in case of power failure. So, it always wants to do the following steps:
1) Expand partition to contain both the current and new positions
2) Expand the file system
3) Shuffle things around within the file system to fit inside the new postion
4) Shrink the file system to the new position
5) Shrink the partition to the new position
The way gparted wants to do it, any space between the positions must be unoccupied for it to work.
But if the current and new positions don't overlap, then it's possible in principle to somehow create a new file system in the new position and then just edit the partition table.
dd can do the raw data copy.
I'm not sure if there's a convenient tool to edit the partition position.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.