Windows and linux partitions

How to Partition a Drive for Linux and Microsoft Windows

Book image

If you only have a single hard drive available in your PC, you need to create separate areas (called partitions) on the hard drive for Windows and Linux. This article walks through the process of how to do that, but first, you need to understand how partitions work.

Three types of partitions are available: primary, extended, and logical. A hard drive can have three primary partitions and one extended partition. Each primary partition acts as a separate hard drive as far as the operating system is concerned. Inside the extended partition you can have up to 12 logical partitions — think of an extended partition as just a cardboard box that contains the logical partitions. Logical partitions behave similar to primary partitions and hold data; extended partitions just hold logical partitions. Because I can’t predict what software you want to install, I recommend having at least 10GB of space available in a partition for your Linux installation. More is always better because it gives you more room for downloads and even more programs.

Make a note of the partition you dedicate to Windows and the one you dedicate to Linux. You need this information when installing Linux.

Those who aren’t starting from scratch for a dual boot likely need to make changes to their current installation. Proceed to the next section to find out how.

How to partition a hard drive with Windows tools

  1. Open File Explorer by clicking the folder icon in the taskbar, or typing file explorer in the search area in the taskbar and selecting File Explorer from the search results.
  2. When File Explorer opens, click This PC on the left-hand side of the window. This displays the status of the various storage devices you have connected to your PC. This figure shows an example of what you might see in File Explorer.

The Windows 10 File Explorer window.

The Windows 10 File Explorer window.

The example shows a single hard drive connected to the PC (assigned as drive letter C). File Explorer shows the drive is 899GB in size, and has 483GB available for use as a second partition.

It’s usually not a good idea to allocate all the free space on your hard drive to Linux; you’ll want to leave some extra room in the Windows partition so you can continue doing things while you’re running Windows, such as downloading and installing patches or saving new files.

After you determine how much space you want to dedicate to Linux, you’re ready to partition the hard drive.

The Windows utility you want to use is the Disk Manager program. Follow these steps to use it:

  1. Right-click the Start icon in the taskbar.
  2. From the menu that appears, choose Disk Management. The Disk Management dialog box appears as shown. The dialog box shows all the hard drives installed on the PC, along with the partitions for each one.

The Windows 10 Disk Management tool.

The Windows 10 Disk Management tool.

The Shrink Volume dialog box.

The Shrink Volume dialog box.

During the shrink process Windows tries to move any data stored near the end of the partition towards the front to make room for the new partition. However, some system files can’t be moved, which may cause a problem and produce an error message. If this happens there are ways to move those files, but it gets much more complicated that what I can cover here. Fortunately, you aren’t the first person to need to do this, so there’s plenty of help available. One place to consult is the Microsoft Windows forum at answers.microsoft.com and you’ll see lots of postings on how to handle this situation.

When the shrink process completes, a new partition appears in the Disk Manager listing. This new partition appears as Unassigned, and not have a drive letter assigned to it by Windows.

If you have lots of space available on your existing Windows partition you’ll probably want a lot more than 10GB of space. The 10GB is the minimum recommended for most Linux distributions to fit the operating system. However, if you download lots of multimedia, you’ll quickly eat up whatever was left after you installed your software! Give Linux as much space as you think you can spare from your Windows environment.

How to partition a hard drive with Linux tools

If you’re in a situation where you don’t currently have Windows installed on the hard drive but would like to partition the hard drive first, you can use Linux tools to do the work for you. The easy solution is to boot your PC using a Live distribution and use the disk management tools available. Plenty of Live distributions include disk management tools by default, but by far the most popular is the KNOPPIX Linux distribution.

The KNOPPIX Linux distribution was the first to create a live Linux version, even back before there were DVDs (it was called a LiveCD!). What keeps KNOPPIX at the top of the list of popular Linux distributions is the myriad of utilities it includes by default. It touts itself as a rescue disk — a way to boot your PC if things go horribly wrong with the existing operating system, and be able to troubleshoot and possibly fix issues.

Follow these steps to partition your hard drive using KNOPPIX:

  1. Download the latest KNOPPIX CD or DVD ISO image from the KNOPPIX website.
  2. Burn the ISO image onto a bootable CD, DVD, or USB stick using a standard ISO image burning tool.
  3. Boot your PC using the KNOPPIX LiveDVD. At the boot: prompt, press the Enter key to start KNOPPIX.
  4. Select Graphical Programs→startlxde from the main menu. The KNOPPIX graphical desktop environment comes up. It’s a fairly bare-bones graphical desktop so it can run on just about any PC, but it gets the job done.
  5. From the KNOPPIX graphical desktop, click the Terminal icon in the taskbar at the bottom of the desktop. A Terminal session starts that provides access to the command prompt.
  6. At the command prompt in Terminal, enter the command: sudo gparted . The GParted application is a popular disk management tool for Linux. It provides an interface similar to the Windows disk management tool, as shown.

Linux GParted disk management

The Linux GParted disk management tool main window.

The GParted Resize/Move dialog box.

The GParted Resize/Move dialog box.

About This Article

This article is from the book:

About the book author:

Richard Blum has more than 30 years of experience as a systems administrator and programmer. He teaches online courses in PHP, JavaScript, HTML5, and CSS3 programming, and authored the latest edition of Linux For Dummies.

Источник

How to Access Linux Partitions in Windows

If you have a Linux distribution sitting alongside Windows on your PC, you’ll have no problem accessing your Windows drive. NTFS, the default Windows file system, is well supported, and most Linux distros will be able to mount NTFS drives with ease.

The same can’t be said for Windows users, however. Common Linux file systems like Ext4 aren’t supported. If you want to access Linux partitions in Windows, you’ll need to install some additional software to do the job.

Choosing The Right Software for Linux Partitions

There are several software options for Windows users looking to access their files on Linux. For many years, Ext2Fsd has been the go-to option, allowing you to read and write to your Linux file systems within Windows itself.

Unfortunately, Ext2Fsd hasn’t been updated since 2017, and the penultimate release, 0.68, had a “critical bug” that could corrupt your data on Ext4 drives with 64-bit mode enabled. The site for Ext2Fsd has gone down, and it’s unclear whether Ext2Fsd 0.69 fixed this bug.

It’s still an option if you need write access to your Linux drive, but given the risks, it isn’t our main recommendation if you have a 64-bit Ext4 Linux partition. Make sure you back up any critical data first and use only the most recent, 0.69 release of Ext2Fsd.

As an alternative, we recommend DiskInternals Linux Reader. It lets you access files from the most common Linux file systems. Unlike Ext2fs, it doesn’t do this through Windows Explorer, but through its own file manager. It’s also free for you to use.

It won’t let you write files to your Linux drive directly, but you can save any files you need to edit to your Windows drive. A similar, open-source alternative, Ext2read, is also available for you to use, with many of the same features. You don’t need to install Ext2read, as it comes as a portable .exe file.

Using DiskInternals Linux Reader

DiskInternals Linux Reader is freeware, so you don’t have to pay to download and use it.

To begin, you’ll need to download the Linux Reader installer. Open the installer, accept the terms, confirm your installation location and click Install.

Once the installation is complete, make sure the Run DiskInternals Linux Reader checkbox is checked, and then click Finish.

The Linux Reader client is well designed and has some similarities in design to the Windows File Explorer. You’ll see a list of your drives, including any removable storage like USB flash drives or SD cards.

Find your Linux partition, under either Hard Disk Drives or Drives with Removable Storage.

You can either double-click to view your files, or right-click and select Open Partition from the drop-down menu instead.

You’ll see a split-screen, with the top half showing files and folders on your Linux drive. As we’ve mentioned already, you can’t make any changes to the drive directly. You’ll need to copy the files to your Windows drive, or to another Windows-suitable partition.

To do this, select the files and folders you want to copy. Right-click the selected files and click Save.

In the Export Wizard, you’ll see the option to save files is already selected.

Click Next.

Choose the location to save your files and folders. You can type the location yourself, or click Browse to find a suitable output folder before clicking Next.

You’ll see a final list of your chosen files and folders. If you want to remove any files or folders before the copying process begins, uncheck the checkbox next to any items.

Click Next to proceed.

Once completed, you’ll see a final confirmation, confirming the number of files and folders copied, as well as the save location. Click Finish to close the Export Wizard.

While DiskInternals Linux Reader doesn’t allow you to modify files or folders directly, you can use it to quickly access any essential Linux files. You can then transfer these back to your Linux drive when you’re running Linux or, if you’re willing to take the risk, you can use Ext2Fsd instead.

Read & Write Access With Ext2Fsd

Ext2Fsd, as we mentioned previously, is the only option for users who need to make changes to files or folders on their Linux drive directly from within Windows. Once it’s installed, you can access your drive from within Windows File Explorer as normal. Ext2Fsd 0.69 is recommended, especially for users with Ext4 64-bit Linux partitions.

To start, download the Ext2Fsd installer file and begin the installation. Accept the terms and installation location, and make sure that under Select Additional Tasks, all the checkboxes are checked.

Once the installer is completed, you’ll be asked to restart your PC. Safely close any essential programs and click Finish to reboot.

Once you’ve rebooted, see if you spot your drive in File Explorer and double-click to open it. If you don’t see it, open the Ext2 Volume Manager, right-click your drive, and click Assign Drive Letter.

As soon as a drive letter is assigned to your drive, you should be able to see it in File Explorer. You’ll be able to create, copy, move, or delete files as you would any other drive, but given the risks, don’t use this for critical data unless you’re certain you have a backup available.

Safely Accessing Your Linux Files On Windows

The safest method for accessing Linux files or folders is to use a read-only option like DiskInternals Linux Reader. With software like this, the chances of corrupting your files are zero.

If you absolutely need to edit files or folders on your Linux drive, Ext2Fsd will allow you to do it, but take care to avoid risks by using the most recent version, and only on a drive with non-critical files.

If you want to avoid this problem in the future, consider having a “pooled” Linux partition drive (formatted as NTFS) to share your files across both systems, or sync your files to Google Drive instead.

Ben Stockton is a freelance technology writer based in the United Kingdom. In a past life, Ben was a college lecturer in the UK, training teens and adults. Since leaving the classroom, Ben has taken his teaching experience and applied it to writing tech how-to guides and tutorials, specialising in Linux, Windows, and Android. He has a degree in History and a postgraduate qualification in Computing. Read Ben’s Full Bio

Did you enjoy this tip? If so, check out our YouTube channel from our sister site Online Tech Tips. We cover Windows, Mac, software and apps, and have a bunch of troubleshooting tips and how-to videos. Click the button below to subscribe!

Источник

Читайте также:  Менять права доступа linux
Оцените статью
Adblock
detector