Quantcast
Viewing all articles
Browse latest Browse all 11

Shrink EXT3 and Expand NTFS

I have a partition table that looks like this:

[root@tower ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x44fdfe06

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          13      104391   83  Linux
/dev/sda2              14         275     2104515   82  Linux swap / Solaris
/dev/sda3             276       36828   293611972+  83  Linux
/dev/sda4   *       36829       38914    16748544    7  HPFS/NTFS

/dev/sda3 is mounted to /. I would like to shrink the ext3 volume /dev/sda3so I can expand the NTFS volume /dev/sda4 and add about 15GB or so. How would I go about this? I would like to shrink the ext3 partition online if possible, so I don't have to bring down the server. I imagine my steps would be something like this:

  1. Delete the sda3 partion with fdisk.
  2. Create a new partition 3 with start cylinder of 276 and end cylinder of 35000 or so.
  3. Delete sda4 partition.
  4. Create new partition 4 with start cylinder of 35001 and end cylinder of 38914.
  5. Write changes.
  6. resize2fs /dev/sda3
  7. ntfsresize -size 35GB /dev/sda4 (35GB would equal whatever my partition is sized to in fdisk)

Can anybody double check my steps? I'm too scared to try. :)


Viewing all articles
Browse latest Browse all 11

Trending Articles