LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-14-2017, 05:39 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Moving a partition.


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.
 
Old 11-14-2017, 05:58 PM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
Your question is unclear. Could you elaborate?
 
Old 11-14-2017, 06:20 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
[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.
 
Old 11-14-2017, 06:41 PM   #4
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
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
 
Old 11-14-2017, 08:23 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Gparted is a sound way to move, copy and resize partitions too. Boot from a live cd usually if any of this is mounted.
 
1 members found this post helpful.
Old 11-15-2017, 05:16 PM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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?
 
Old 11-15-2017, 08:33 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
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.
 
Old 11-15-2017, 10:17 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
No, as far as I know the free space has to be adjacent to the desired partition to be moved.

As suggested you can create a partition in space c and copy data from a.
 
Old 11-16-2017, 02:19 PM   #9
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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?

Last edited by stf92; 11-16-2017 at 02:24 PM.
 
Old 11-16-2017, 03:42 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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.

Last edited by michaelk; 11-16-2017 at 04:25 PM.
 
Old 11-16-2017, 04:22 PM   #11
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
Old 11-16-2017, 07:39 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
I think gparted uses file by file to if you wish to use the copy partition feature. Generally file by file is fast.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving a folder, versus moving its contents (within the same partition) the dsc General 7 06-29-2012 04:46 AM
Moving one partition to another partition on the same hard drive ruguloo Linux - Desktop 2 05-10-2011 10:01 AM
,dmrc problem after moving /home partition to NTFS partition yeehung Linux - Newbie 1 11-14-2007 06:17 AM
moving files from windows partition to linux partition M O L8ingN2dust Linux - Newbie 11 01-08-2006 09:11 PM
Moving from extended partition to primary partition joelbudgor Linux - General 5 05-26-2004 06:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration