View Full Version : Adding a new partition to an established drive
CoW]8(0)
04-20-2006, 04:45 AM
If I add a linux partition to a hard drive which has been in use long enough to have a bit of data everywhere, what happens when this new partition is created? Is there a defrag process before the partition is created? Or is the linux partition also forced to be fragmented?
Bones
04-20-2006, 07:07 AM
You must have some free space on the drive to create a new partition. This is not the same as having free space on the file system, and has nothing to do with how fragmented it is. In other words, the drive must have unpartitioned space in order to create a new partition.
If your drive is completely occupied by a single partition, without any free space left over, then you will need to shrink the filesystem on it and then shrink the paritition. Every file system resizer I am familiar with will handle the defrag, if required. There are tools that will take care of all this for you, including open source ones; QTparted, for example.
CoW]8(0)
04-20-2006, 12:42 PM
But if you originally have 1 partition on a 100GB drive and decided to add another 50GB partition on it, would there be fragmentation between the two because the original first partition would be spread out all over the drive? Note that just because the data is spread out on the drive doesn't mean the hard drive is full. All this means is that the data is not contiguous.
Bones
04-20-2006, 06:39 PM
You're missing an important fact that I alluded to in my previous post: a normal filesystem is contained entirely within one partition. Do not think of your files as spread out all over a drive; they are spread out all over the filesystem, which occupies one partition.
Again, if you use a good partitioning tool, it will do the following things for you:
1. Resize the filesystem on the existing partition, moving files if needed
2. Resize the partition to make free space for the new partition
3. Create the new partition in the new free space
Xipher
04-20-2006, 07:22 PM
the second part of number 1 is key. I have used a cheap resizing tool, that didn't move the files on the file system that ended up outside the boundry, and it ended up hosing the FS. I have learned my lesson from that experience.
CoW]8(0)
04-20-2006, 07:56 PM
Recommend any specific partioning tools?
Bones
04-20-2006, 08:03 PM
I like open source tools. QTparted has an ugly but straightforward GUI, very simple to use. Supports NTFS. The Knoppix livecd has it.
Back up your data prior to using ANY resizing/partitioning tool.
sordid
04-20-2006, 11:29 PM
I've been swearing by Partition Magic for years, but never swearing at unless it was my own stupidity.
Oops, created an NTFS partition for C:, FAT32 on D:
Oops, rebooted with a Win98 boot disk
Oops, formatted C: without double checking first
With any partition resize/move, a sudden loss of power _may_ hose some files or the entire partition that's being worked on. However, I would greatly assume that with the maturity of a lot of the software out there (especially PQMagic), file fragment movements would happen incrementally so that if you do have a power hiccup, everything that was moved during will be correctly updated in the tables as it goes. Don't quote me on that though :p
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.