How To Resize ext3 Partitions Without Losing Data - Page 3
4 Merge Two ext3 PartitionsIn this example I have my system partition /dev/sda1 again (about 6GB of size) which is followed directly by the partition /dev/sda3 (about 4GB of size) on the hard disk. /dev/sda3 is mounted to the /data directory and doesn't hold files needed by the Linux system, just user data. The current partitioning looks like this: df -h Filesystem Size Used Avail Use% Mounted on To merge /dev/sda1 and /dev/sda3, we have to delete /dev/sda3 and then enlarge /dev/sda1 as described in chapter 3. This means that all data on /dev/sda3 will be lost, so if you need it later on please back it up somewhere else and then restore it to the new and bigger /dev/sda1 afterwards! Now we open /etc/fstab and remove the line for /dev/sda3 there if it exists: vi /etc/fstab The new file without /dev/sda3 could look like this:
Then we unmount /dev/sda3 and run fdisk to delete it. This can still be done on the original system as /dev/sda3 doesn't contain system files: umount /dev/sda3 fdisk /dev/sda (Yes, it's /dev/sda, not /dev/sda1.) The number of cylinders for this disk is set to 1305. Type m to get a list of all commands: Command (m for help): m Now let's delete /dev/sda3: Command (m for help): d Afterwards we write the new partition table to the disk: Command (m for help): w Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. Now we shut down the system: shutdown -r now and boot into our Knoppix Live-CD (or your rescue system). From here on the steps are identical to chapter 3, beginning with su umount /dev/sda1 so please refer to that chapter.
5 Links
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning
Recent comments
1 day 39 min ago
1 day 1 hour ago
1 day 3 hours ago
1 day 8 hours ago
1 day 15 hours ago
1 day 16 hours ago
1 day 20 hours ago
1 day 23 hours ago
2 days 3 hours ago
2 days 8 hours ago