LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-10-2007, 10:17 AM   #1
sheintze
Member
 
Registered: Jan 2007
Posts: 30

Rep: Reputation: 15
How to rearrange partitions on a disk?


According to http://www.linuxquestions.org/questi...d.php?t=534111 I need to rearrange the order of the partitions on my disk.

How may I take an empty 300GB USB disk and precisely recreate the partitions on my USB except in an different order?

I had been using dd if=/dev/sda of=/dev/sdb and while that is precise, it does not change the order.

I want to put the boot partition first!

I guess I could use qtparted and write down the precise sizes of the partitions.

Can I use

cp /dev/sda3 /dev/sdb1

where sdb1 does not exist yet and it creates sdb1 precisely the correct size and then

cp /dev/sda1 /dev/sdb2

where sdb2 does not exist either and it is creatd to be precisely the correct size and is appended precisely behind sdb1?

I don't think the cp command does this, but is there a command that does? After all, cp /dev/sda /dev/sdb is very effective at creating partitions -- just not in the order I want.

Siegfried
 
Old 03-10-2007, 10:28 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
cp does not copy partitions, nor does it copy disks
cp does not create partitions

In short, cp is not in any way relevant to what you are trying to do.

I have to believe that it will be easier to re-install on your new drive, but--in principle--you can do what you want with dd (and possibly with some partition manager)

FIRST--NO MATTER WHAT METHOD YOU CHOOSE---MAKE SURE EVERYTHING IS BACKED UP

One way to use dd is to image each partition into a file. Then you can use that image to put the partition wherever you want on the new disk.
Give us your total configuration, including all available drives, and we can provide some more detailed instructions.

But again--reinstalling may be MUCH easier.
 
Old 03-10-2007, 06:08 PM   #3
RevenantSeraph
Member
 
Registered: Jan 2007
Distribution: Ubuntu
Posts: 66

Rep: Reputation: 15
Have you tried using a GParted boot disc to rearrange/resize your partitions? It's a beautiful thing.
 
Old 03-10-2007, 07:39 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Just use [c]fdisk to create the partitions you want.
Mount 'em and copy 'em with "cp -a /mnt/source/* /mnt/dest" (play with the syntax to get what you want - I think that'll work).
No need for backups as your source is always still there if you need to re-do it.

Easy.
(er, the above presumes only *nix (or fat) partitions are involved. NTFS can't be moved this way if you need to boot it)
 
  


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
rearrange folder structure using mp3 tags roemisch Linux - Software 1 04-18-2005 10:15 AM
removed disk partitions - disk is now too small jordanthompson Linux - Software 18 12-09-2004 03:07 PM
How many partitions on one disk? alanbarnard Linux - Newbie 3 12-04-2004 09:04 AM
Rearrange device order in boot up 3DZign Linux - Laptop and Netbook 1 03-27-2004 08:09 PM
can't rearrange desktop icons - kde arch23 Fedora 1 01-01-2004 11:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:35 AM.

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