Allocating a Windows Disk Partition to Fedora Linux

From Techotopia
Jump to: navigation, search
PreviousTable of ContentsNext
Installing Fedora Linux on a Windows System (Dual booting)Configuring Fedora GNOME Screen Resolution (Removing the Black Border)

Take your Fedora Linux Skills to the Next Level
Fedora 31 Essentials book is now available in Print ($36.99) and eBook ($24.99) editions. Learn more...

Buy Print Preview Book

One of the most common configuration requirements for a new Fedora Linux installation involves reducing the size of the pre-existing Windows partition on the disk drive and using the resulting space to install Fedora Linux. This so called "dual boot" configuration allows the user to have both operating systems installed on the disk drive with the option to boot one or the other when the system is powered on. Performing this type of installation was covered in the Installing Fedora Linux on a Windows System (Dual booting) chapter of this book.

This chapter is intended for users who have decided they like Fedora Linux enough to delete Windows entirely from the disk, and use the resulting space for Linux. In the following sections we will work through this process step by step.


Contents


Deleting the Windows Partition from the Disk

The first step in freeing up the Windows partition for use by Linux is to delete it. Before doing so, however, it is imperative that any data you need to keep is backed up from both the Windows and Fedora partitions. Having done that, it is safe to proceed with this chapter.

Fedora Linux ships with a tool called GParted which is a graphical disk partitioning tool. Since GParted is not typically installed by default, it may be necessary to install it before proceeding with this tutorial. If GParted is not installed, it may be installed from a terminal window (Applications->System Tools->Terminal) using the following commands:

su -
yum install gparted

To invoke GParted from within a terminal window enter the following command:

gparted

Alternatively, GParted may be launched from the desktop menu system by selecting Applications->System Tools->GParted Partition Editor.

Enter your password when prompted to do so and wait for the GParted application to load:


Fedora linux windows gparted main.jpg


The Windows partition can be identified by the filesystem type. In this case the filesystem is of type NTFS (which corresponds to sda1). A FAT filesystem also indicates a Windows partition. The ext3 partition is our current Linux partition. We are now going to delete the Windows partition, but first need to unmount the partition. To do so, right click on the partition, either in the list or in the graphical representation of the partitions and select unmount. Enter the root password if prompted to do so.

The next step is to delete the partition. Once again, right click on the partition in the list and select Delete. The delete task will be listed as Pending. To commit the change, click on Apply in the GParted toolbar.

Once the deletion is complete the former Windows Partition will be listed as unallocated. This is now ready for us to use as a Linux partition.

Formatting the Unallocated Disk Partition

The next step is to format the partition so that it can be used by Linux. By default Fedora Linux uses the ext3 filesystem format. This is a powerful filesystem format which supports features such as disk journaling which is useful for restoring damaged data.

To format the unallocated partition, select it by clicking on it in the list and click on the New toolbar button. The following Create a new partition dialog will appear:

Fedora linux gparted create new partition.jpg

Unless you wish to create multiple partitions, want to leave some unallocated space or need a filesystem format other than ext3, leave the settings as they are. This will use the entire space for the partition. Click on Add and the action will be listed as Pending. Click on the Apply toolbar button to commit the change and the new ext3 partition will be created.


Editing the Boot Menu

The next step is to modify the boot menu. Since this was originally a dual boot system, the menu is configured to provide the option of booting either Windows or Linux. Now that the Windows partition is gone, we need to remove this boot option. This is achieved as follows:

su - 
gedit /boot/grub/grub.conf

Towards the bottom of the grub.conf file you will see a section similar to:

title Windows
        rootnoverify (hd0,0)
        chainloader +1

Delete this section from the file. Also check to see the default= value to make sure the default is not set to the partition which was just deleted. Once the changes have been made to the file save it.

Mounting the New Partition

Finally, we need to mount the new partition. In this example we will mount it in a directory called vol1. You are free, however, to mount the new partition using any valid mount point you desire. First we need to create the directory to act as the mount point:

su - 
mkdir /vol1

Secondly, we need to edit the mount table so that the partition is automatically mounted each time system starts:

gedit /etc/fstab

At the bottom of the /etc/fstab file, add the following line to mount the new partition (modifying the /dev/sda1 device to match your environment):

/dev/sda1 /vol1 ext3 defaults 0 0

Finally, we can manually mount the new partition (note that on subsequent reboots this will not be necessary as the partition will automount as a result of the setting we added to the /etc/fstab file above).

mount /vol1

To check the partition, try running the following command to display the available space:

df -h /vol1

You should see output similar to:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             7.7G  146M  7.2G   2% /vol1

Take your Fedora Linux Skills to the Next Level
Fedora 31 Essentials book is now available in Print ($36.99) and eBook ($24.99) editions. Learn more...

Buy Print Preview Book