13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 5 ■ WORKING WITH FILESYSTEMS■ Note This method will work only if the total size of your second partition is greater than ((2 × space used on2nd partition) + desired expansion of the first partition). Here, 105GB > (2 × 40GB) + 5GB, so we’re fine to goahead. See the description of the process and Figure 5-1 for an explanation of this math, or if you don’t have thismuch spare space, another option is described later in this recipe.What you’re going to do is as follows (it is a little complicated, but it does work!):1. Divide the second partition (/dev/hda2) into two sections (/dev/hda2 and/dev/hda3), each one of which is big enough to hold all the data currently inthat partition (here, 40GB).2. Move the data into the second of those two partitions (/dev/hda3).3. Delete the now-smaller /dev/hda2 to generate some free space into which/dev/hda1 can expand.4. Expand /dev/hda1 as required.5. Create a new /dev/hda2 in the free space that’s left over. (This new /dev/hda2needs to be at least as big as the data that’s now in /dev/hda3).6. Move the data from /dev/hda3 back into the re-created /dev/hda2.7. Delete /dev/hda3.8. Expand /dev/hda2 into the free space that /dev/hda3 occupied.Effectively you’ve moved the start point of /dev/hda2 along a little to allow more room for /dev/hda1;but because you can’t move the start point of a partition, it’s necessary to do this complicated shufflingaroundprocess (see Figure 5-1).Figure 5-1. An illustration of what you’re doing to your hard drive in this process124Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!