Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



PARTITIONING TOOLS
( And which ones not to use )

Our good friend Striker sent me some very useful info about partitioning tools. I copied the full text here so we can learn from it:

QUOTE (Striker @ Forum 2004)

What's the difference between partitioning your drive with Windows applications and partitioning with Linux applications when preparing the drive for installing Linux ?


"Let us take a hard disk drive and install Linux on it", isn't that something you said to yourself sometime ago ? Or something similar like "I've got this spare hard disk drive and there are so many distros around,  let's set up something in Linux"? Well, sooner or later you will have to partition the drive in question to be able to install any Linux flavor on it. That brings us to the next question: "Which application to use for that". In the windows territory there are many applications that will do it for you with a couple of mouse clicks, with or without graphical interface. "Hey, come to think of that? there's a partitioner in windows XP, really good looking and it works, and I also have partition magic laying around. Everybody uses this, so Linux partitioning will be an easy one!"  Or maybe not so easy?

I have heard something like the above scenario too on more than one occasion, almost always after I was called due to problems with the system in question. And after I asked how they did the partitioning, either one or the other non-Linux application was used to do the job of partitioning. When I asked why they used that and not the default Linux partitioner which comes with every distro nowadays, the answer was something like "because it was easier"?

So in order to set things straight for once and for all, I experimented with this back home, and I hereby present you some results / observations.

For this I used a completely new, brand named hard disk drive to install Linux on, along with an in-use hard disk drive, same brand, same type, same capacity. On the first drive there were 4 partitions, C-D-E and F, all windows partitions with a FAT32 file system. In the machine were also 2 floppy drives, A and B, and also a CD writer drive G and a CD player drive H.

After the second hard disk drive was in the machine, I used partition magic to create the necessary partitions on it for Linux to be installed. That was no problem at all, Linux got installed and ran well for a couple of weeks. Then the problems started, first in Windows: Partition Magic has an application you can install for viewing the partitions, which I did install. This gem started to complain about detecting some cylinders not starting at their appropriate place and asked if it was allowed to correct things. Well that sounded alarming enough so I said yes, do it. Well, the machine just started and no further problems were encountered? until the next start the following morning. Then the same question appeared on the screen. This went on and on, day after day ?.

Then one day, the Linux distro I had installed wouldn't even boot: especially for this experiment I didn't do any updates and I didn't even install one extra package: the distro was there just like I installed it a few weeks ago. "So what the heck is going on here, it's getting weird now" I spoke to myself, not knowing what was the actual culprit. I even made a second boot disk, like I always did: using the second boot disk I was not able to boot Linux either.


Second attempt: Using Windows XP partitioner

I decided to do a complete reinstall: after Windows XP  was up 'n running again on drive C:\, I used XP's Disk Management partitioner to repartition the second hard disk drive and do a reinstall of Linux. While installing Linux, I formatted the drive to reiserfs. So I partitioned in Windows and formatted in Linux. While installing Linux, I encountered several difficulties, amongst others, the partitions where recognized the wrong way.  See below for the fstab file.


/dev/hdd6 /  reiserfs defaults 1 1
/dev/hdd2 /data1  auto noauto,user 0 0
/dev/hda1 /windows/C vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0
/dev/hdd1 /windows/D vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0
/dev/hda5 /windows/F vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0
/dev/hda6 /windows/G vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0
/dev/hda7 /windows/H vfat users,gid=users,umask=0002,iocharset=iso 08859-1,code=437 0 0
/dev/hdd3 swap  swap pri=42 0 0
/dev/hdd5 swap  swap pri=42 0 0
devpts  /dev/pts  devpts mode=0620,gid=5 0 0
proc  /proc  proc defaults 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
/dev/cdrecorder /media/cdrecorder auto ro,noauto,user,exec 0 0
/dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0
/dev/fd0  /media/floppy auto noauto,user,sync 0 0
/dev/fd1  /media/floppy1 auto noauto,user,sync 0 0

To make this a little more understandable, below is what actually was in the machine and how it should have been recognized: compare it to the markings in red above.

/dev/hda1 windows C
/dev/hda5 windows D (volume name = data1)
/dev/hda6 windows E (volume name = data2)
/dev/hda7 windows F (volume name = storage)

/dev/cdrecorder  was actually the cd writer drive G
/dev/cdrom was actually the cd player drive H

The comparison above shows a real mess.

As you can clearly see from the above, partitioning  with a non-Linux partitioner may result in mis recognizing the partitions which result in all the weird behavior mentioned in the first paragraph. Again, after a few weeks there were some problems encountered, one of them not being able (again!) to boot Linux.



The right way: Partitioning in Linux for Linux setups

"I've had it, throw this thing out of the window " you might think or something similar, but why not do it the right way for once and for all, what is the right way?" I took the opportunity to do a complete reinstall again. Remember, it was an experiment? (I never had the intention to throw a machine out of the window for real, but okay ? sometimes it's tempting ! )

To make a long story short, I reinstalled Linux after I decided to partition the second hard disk drive using  the Linux installer. Therefore I tested cfdisk to do the partitioning, and a second time I used Mandrakes partitioner while I was installing a multi boot environment on a different machine.

To my own surprise all partitions got recognized okay in all distro's I attempted to install, including the CD drives. I loaded the machine with 6 different distro's, updated them, installed extra packages, no problem to this today: I'm using this set up now for more than a few months. No more hiccups, no more not-booting-Linux, just "using" Linux and ? it's a multi-boot environment ? Windows.

Let's put one and one together: I did my partitioning for the Windows environment (remember those 4 partitions?)  with DOS fdisk, then installed Windows on the hard disk drive.
For Linux I used a second hard disk drive on which I used Mandrakes disk partitioner to do the partitioning, but I could have used cfdisk too.
That left me with a usable Windows and Linux : if I would have partitioned the Linux drive again with anything else than a Linux partitioner, I would have created a mess like above again.



Thanks a bundle for this elaborate info Striker !



So what partitioning tools can we recommend ?? ( in order of pure personal preference ):

1) Diskdrake ( The default Mandrake tool, by far superior and easy to use even for people that never came close to a partition before )
2) fdisk ( commandline tool for the more advanced, but still very intuitive )
3) Diskdruid ( The RedHat partition tool )
4) QTParted ( GNU clone of Partition Magic, the tools from SUSE, RedHat and PCLos are based on this )
5) Yast ( the SUSE partition tool )
6) Qparted ( the non-GUI brother of QTParted, I would go for fdisk myself )

You see there are plenty of tools . . . so, again, please use a Linux tool to make Linux partitions !!



Bruno


-- Feb 1 2005 ( Revised Dec 12 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email