LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to divide a partition in 2 partitions? (https://www.linuxquestions.org/questions/linux-software-2/how-to-divide-a-partition-in-2-partitions-575138/)

rakeshj 08-06-2007 12:52 PM

How to divide a partition in 2 partitions?
 
Hello all,

I recently installed Xubuntu on my laptop having Windows XP & one hard disk.

First I partitioned my hard disk into 2 partitions & installed Windows XP on one partition & left second partition for installing Xubuntu.

While installing Xubuntu from Desktop CD, I wanted to create 4 partitions: First - ext3 for Xubuntu
Second - Swap
Third - FAT32 data
Fourth - NTFS data

But after creating first three partition, it does not
allow me to create 4th partition. So I created third
partition combining sizez of Third & Fourth partition
(planned originally).

Now, after installing Xubuntu, I want to split the single
data partition (FAT32) into 2 partitions (one FAT32 &
other NTFS) as planned originally. As so far I have not placed any data in this partition, I have no problems in
reformattiong & spliting it into 2 partitions. I guess the mistake I made during partitioning was that I declared all four as Primary partition & possibly more than 4 Primary partitions (on single disk) are not allowed? So kindly suggest how to have above four partition (in addition to one partition for Windows XP).

Thanking you. Best regards, RAKESH

ko_wei13 08-06-2007 01:14 PM

Since you have the Windows XP, you can right click on the My Computer and select Manage. Under the Disk Management, split and format the partition you want as Secondary partition if you can view the partition.
Alternatively, you can use QtParted, the free partitioning software to do it.

bigrigdriver 08-06-2007 01:16 PM

Make the XP partition the only primary partition.

Make the remainder of the disk one extended partition. Inside the extended partition, make all the remaining partitions you need.

pixellany 08-06-2007 01:16 PM

Please clarify the current configuration......It sounds like you have Windows installed first (on the first partition??) Run fdisk -l and post the results here.

To create more than four partitions, you simply have to create an "extended" partition as on of the first 4. Some partitioning tools do this automatically, when you create "logical" partitions. The best tools to use are GParted (comes on its own live CD), and QTParted (comes with many live CD Linux distros).

What you want to wind up with are 3 primaries--ideally with Windows on #1, and one extended partition which fills all the remaining space. You can then create additional logical partitions as required.

When we know the size of your disk, we can make more suggestions.

rakeshj 08-10-2007 03:56 AM

Hell All,

Thanks for the responses.

Here is the output from fdisk -l:

rakesh@rakesh-laptop:~$ sudo fdisk -l

Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3824 30716248+ 7 HPFS/NTFS
/dev/sda2 3825 5648 14651280 83 Linux
/dev/sda3 5649 5680 257040 82 Linux swap / Solaris
/dev/sda4 5681 7296 12980520 b W95 FAT32


I installed gparted from Xubintu distibution using apt-get install command. Seems it uses (at least it man page referes to) parted (GNU partition utility).

Output from parted utility print command is as under:

Disk /dev/sda: 60.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 31.5GB 31.5GB primary ntfs boot
2 31.5GB 46.5GB 15.0GB primary ext3
3 46.5GB 46.7GB 263MB primary linux-swap
4 46.7GB 60.0GB 13.3GB primary fat32

I read man pages for parted but could not exactly figure out how to do the
following (as suggested by all):

1. Change partition types to Extended (except for Windows partition which
should be Primary).
2. Divide /dev/sda4 into 2 partions (say 7GB & balance size -- possibly
logical partitions?) & make first part as FAT32 (like now) & second part
NTFS preferably without destroying current contents on this partition (if
possible?
).

Kindly suggest.

Is GParted utility mentioned above (by Pixellany) different from the GParted
installed by me from Xubuntu distribution sites? This is graphical utility but
in this also I could not find out how to divide a partition in two partitions &
modify their file system types. On exit it printed the following message on my
terminal:
======================
libparted : 1.7.1
automounting disabled
======================

What does this message mean?

Thanking you. Best regards, RAKESH

rakeshj 08-11-2007 05:17 AM

Hello All,

I tried wi gparted but it seems I can not divide a partition into 2 parttitions (I umounted the partition before trying to use gparted) as I have all the partitions (all 4) declared as Primary Partitions.
I don't know how to convert a partition to Extended partition before I can make Logical Partition in it.
Finally, what I need to do is to some how have an Extended partition & then have 2 Logical Partitions in it. One of these should hold all data from my existing
FAT32 partition & other I want to be a NTFS partition.
Is it possible to do it without:

1. First saving data from FAT32 partition to some other
partion.
2. Removing the partition completely so it becomes
unformatted.
3. Recreate it as Extended Partition under Windows.
4. Create 2 Logical Partitions on it (one FAT32 &
other NTFS). I am not sure if this step can be
done only under Windows or also can be done under
Xubuntu (HOW).
5. Copy back the data to FAT32 partition where it
was saved.
6. Create mount point for NTFS partition & make
necessary changes in /etc/fstab & use mont -a to
mount the two partitions.

Kindly suggest if there is any other simpler alternative & if all can be done under Xubuntu using
parted, gparted, fdisk etc.

Looking forward for an quick reply.

Best regards. RAKESH

PS: Details on current file systems are given in
outputs from fdisk & pated print commands in my
earlier post.

syg00 08-11-2007 06:04 AM

You cannot create any more partitions.
The architecture (from MSDOS days) only allows 4 primary partitions. To use logical partitions, you must first create an extended partition - this will be the "container" for all the logicals. This extended must be one of the 4 allowed primary partitions.

So you have to delete at least one partition to create the extended, then the logical(s). Back up your data first, and do it - from either Linux or Windoze.

masterclassic 08-11-2007 09:16 AM

I don't know any tool that could split a partition in 2.
You can work with Gparted. Use one of the latest versions of the LiveCD, because Ubuntu includes a very old and buggy version.

As other friends already told, you have to make at least an extended partition and put there more (logical) partitions. Only w!ndow$ need a principal partition, so give it to them (before you put them in the trash can). Other systems can do anywhere (except perhaps Solaris or BSD ? I'm not sure).

masterclassic 08-11-2007 09:20 AM

Quote:

Originally Posted by syg00
You cannot create any more partitions.
The architecture (from MSDOS days) only allows 4 primary partitions.

Another great invention by the king Bill, I think!
Just like the 640KB memory model. At the time, he told that 640 KB would be enough to do anything forever :D

rakeshj 08-12-2007 02:54 AM

Thanks for the feedbacks.

So now it is clear to me that I must backup my data on the partition which is
currently a Primary partiton, Delete the partition to convert it into Unused Space & then create an Extended Partition in the space & then create 2 logical
partions in this extended partion, one as FAT32 & another as NTFS & restore backed up data to FAT32 partition.

I guess I can locate latest Gparted LiveCD download through Google?

Thanking you again. Best regards,

rakeshj 08-12-2007 01:04 PM

Thanks to all for helping me in repartitioning the Primary partition into 2 Logical Devices
by their valuable suggestions. Gparted LiveCD is a very useful tool.

Now, a minor query:

Earlier the partionined /dev/sda4 was mounted on /osshr. But after diving it into 2 partitions, these partitions are mounted on /media/disk & /media/disk-1. It is not a problem
but for understanding the concept I want to know the following:

1. Earlier /etc/fstab had the following entry for /dev/sda4:

# /dev/sda4
UUID=1728-A5BF /osshr vfat defaults,utf8,umask=007,gid=46 0 1

But, now these lines are commented out & there are no lines in /etc/fstab
for new partitions (Logical devices /dev/sda5 & /dev/sda6). But these disks
show on desktop & mount -a is able to mount these on /media/disk & /media/disk-1.
How this happens?

2. How can I find out UUID numbers for these two devices? Can I modify /etc/fstab to
contain these UUID numbers corresponding to /dev/sda5 & /dev/sda6 & mount on some
directories other than /media/disk & /media/disk-1 eg /shrfat & /shrntfs?

Thanking you again. Best regards, RAKES

masterclassic 08-12-2007 04:56 PM

The Gparted project is part of sourceforge.
http://gparted.sourceforge.net/index.php
The latest version is 0.3.4-8 (about 50MB ISO file), but you could even try -7 or -6 versions if you have any problem with boot-up and hardware detection.


There, you can also find "clonezilla" (a partition copy+cloning tool) together with gparted, in a livecd (~130 MB ISO).

syg00 08-12-2007 05:04 PM

Ubuntu and its derivatives moved to UUID in fstab at 7.04. It has advantages and disadvantages - more of the latter if moving partitions around and/or sharing partitions across distros.
Your initial fstab was built bythe *buntu installer - you can edit it (anytime) with sudo.

You can generate the UUID for new partitions with uuidgen.


All times are GMT -5. The time now is 04:11 PM.