LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-17-2006, 08:30 AM   #16
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612

Yeah that may work if they are exactly the same total size, which is harder than you think... You may need to use sfdisk to make it happen, or at least to find out what the sizes really are. fdisk may not report correctly.
Be sure to do everything at once, though. If you remove sdb1, sdb2 and quit fdisk sdb3 becomes sdb1. Of course the data is not moved on the disk. Instead a hole is left. When you create a new partition then it picks up this space as a starting point for the new partition. Usually lots of sectors get lost.
 
Old 11-17-2006, 08:33 AM   #17
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,007

Rep: Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099
Presuming primary partitions, no damage will be done by deleting partition(s).
Period.
No if, no but.

Logical partitions can (sometimes) cause renumbering issues, however the data is still safe.

Regardless, take note of my sig.
 
Old 11-17-2006, 01:59 PM   #18
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
I think when gnashley said you'd "lose the info in the partitions" he meant that you'd lose the data in those partitions. That's pretty much a given if you delete a partition.

In any case, as you know, each partition starts and end at a particular point on the drive. Suppose sdb1 is currently defined as cylinders 1 through 100, sdb2 is 101 through 500, and sdb3 is 501 through 1000. (I'm just making up the numbers). If you start cfdisk, then drop sdb1 and sdb2, the result will be free space between cylinders 1 and 500. (This has no effect on sdb3, and you do not want to make any changes to sdb3, so leave it as is.) While still in cfdisk, you can then created two new partitions out of that free space, perhaps such as redefining sdb1 as 1 through 50, and sdb2 as 51 through 500. Be sure to specify the appropriate file system for each new partition (eg, swap, ext3, and so forth)

At this point sdb1 would occupy 1 - 50, sdb2 would occupy 51 - 500, and sdb3 would occupy 501 - 1000. Save your changes, reboot, and the result will be that you have taken space away from sdb1 and given it to sdb2. sdb3 will be the same as it was before. Not to keep repeating the same point, but as sys00's sig reiterates, be sure to make a backup of any important data.

Good luck with it. I've done this exact operation many times in the past, and although it may seem intimidating if you've never done it before, it actually is not that big of a deal.
 
Old 11-18-2006, 03:50 AM   #19
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,007

Rep: Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099Reputation: 4099
Quote:
Originally Posted by J.W.
I think when gnashley said you'd "lose the info in the partitions" he meant that you'd lose the data in those partitions. That's pretty much a given if you delete a partition.
Nope.
I don't presume to know what gnashley meant, but deleting partitions does NOT delete any data.
*NONE*.

You may lose the ability to address the data, but it's all still there until you over-write it.
Creating new partitions does not constituing over-writing the data.
Redefining partition(s) to cover the same space makes the data visible again.
 
Old 11-18-2006, 09:21 AM   #20
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I didn't mean that the data would actually be deleted, just that the pointer to it would be lost in the partition table.
If you deleted sdb2 and sdb3 and close fdisk without creating new ones and reboot, the data is still there. But, sdb4 may become sdb2 meanwhile. Even so, it's data hasn't been moved. Not until you create a new partition and format it will the data be overwritten. If the first partition you create afterwards is larger than the empty space between old sdb1 and sdb4, the partition will use the old space and use new space after the old sdb4 space to finish.
Of course all this means we are still trying to order the partitions physically which is illusion anyway. Still, you can make a mish-mash with uneeded fragmenting of the partitions. Also, as mentioned, because of the different way that different partitioning tools determine the geometry, you may get weird results sometimes and sectors may become lost.
If you know the geometry, using 512*cyl*heads*sectors (multiply by 2 and divide by 1024 twice to get MB) will let you size your partitions so they fall on logical cylinder boundaries and no sectors are unused and fdisk/fsck won't complain.
cfdisk may not be the tool to use for the job. fdisk might do better, though sfdisk is even surer.
For a 2GB difference I wouldn't try what you want.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
repartitioning metalsam Linux - Software 5 07-02-2006 06:39 PM
can you apply 2.6.x kernel config to 2.4.x safely/somewhat safely? silex_88 Linux - Software 3 12-10-2005 12:38 AM
Repartitioning fearofcarpet Fedora 3 09-05-2004 03:16 PM
Repartitioning King4lex Linux - Newbie 4 09-02-2004 07:15 PM
Repartitioning Lazlo Linux - General 3 12-11-2001 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:31 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