|
|
Subject:
Remotely Resizing Partitions in Redhat 7.1 or 7.2
Category: Computers > Operating Systems Asked by: j2geek-ga List Price: $5.00 |
Posted:
16 May 2002 06:58 PDT
Expires: 23 May 2002 06:58 PDT Question ID: 16557 |
How do you *remotely* (using telnet or ssh) resize a partition on a harddrive w/ an ext3 file system running RedHat 7.1 or 7.2? I have a remote server, and do not have access to a local console. It has one giant root (/) partition, and i need to change the partitioning scheme of the drive. Any instructions or tools that you can provide would be most appreciated!!! | |
| |
|
|
The following answer was rejected by the asker (they reposted the question). | |
Subject:
Re: Remotely Resizing Partitions in Redhat 7.1 or 7.2
Answered By: jeanluis-ga on 17 May 2002 07:39 PDT Rated: |
Hello, Assuming this problem isn't already solved. When you say the drive is 3% full, is that less than a gig? If so I would consider the following: 1) Temporarily re-partition the swap space into 2 new partitions One small swap partition and one large ext3 partition, and format them. 2) Copy /* to the new ext3 partition. 3) Re-partition the old ext3 partition (and format it) to the size you want. 4) Restore the data from step 2. 5) Re-partition the swap drive to its orignal size. If the 3% of data is larger than a gig, then you will need to back the data up in some other way (tape backup, burn a dvd-rom or cd-roms) The basic idea is that you back up all the data, re-partition/format the drive, and then restore the data. Also Note: That doing something like this may cause other problems, for example if you re-partition the drive so that the file system is on multiple partitions you will need to edit your /etc/fstab file to mount the new partitions. It may be a good idea to (gasp!) re-install from scratch, :( which I know is a pain in the neck, but it can also be a good excuse to move upto RedHat 7.3. I hope this works out for you, let us know what happens. | |
| |
| |
|
Subject:
Re: Remotely Resizing Partitions in Redhat 7.1 or 7.2
Answered By: samrolken-ga on 22 May 2002 15:10 PDT |
j2geek: Hello. Thanks for your question. The GNU Parted application may be just what you're looking for. It's a console-based partition management program. According to the website of the tool, it is able to resize ext3 partitions, provided the starting location of the partition remains the same. Since you say that your root file system takes up the entire drive, this shouldn't be a problem at all. Related Resources: Parted - GNU Project (FSF) [ http://www.gnu.org/software/parted/ ] Download From: [ ftp://ftp.gnu.org/gnu/parted/ ] Search Strategy: None, I know about parted from personal experience with Linux. | |
| |
|
|
Subject:
Re: Remotely Resizing Partitions in Redhat 7.1 or 7.2
From: mun-ga on 16 May 2002 12:07 PDT |
You'd need to shrink the partition while it's mounted. As far as I've been able to figure out this isn't possible. ext2resize can *grow* a mounted partition, but not shrink it. You can try to run parted or ext2resize on a mounted partition, but the partition will be destroyed in the process. ;) You might have better luck persuing commercial products. PQ's partition magic can resize a mounted NTFS or FAT partition, but I don't think they have a native linux binary that can do that to an ext3 partition. If you find a tool that can resize a mounted ext2, it should be able to resize the ext3 partition you've got. |
Subject:
Re: Remotely Resizing Partitions in Redhat 7.1 or 7.2
From: sysadmin-ga on 16 May 2002 16:31 PDT |
Hey, I dont know about remotely resizing partions but there is software out there that will let you create, merge, and resize partitions. You can probably load the software on the computer and open the program through telnet. I really dont know because I dont use telnet but you can always try. The software is called PartitionMagic (who would of thought) and the link to the site is... http://www.powerquest.com/partitionmagic/ I hope that helps you out some, -SysAdmin |
Subject:
Re: Remotely Resizing Partitions in Redhat 7.1 or 7.2
From: random-ga on 20 May 2002 12:49 PDT |
What a fun question, it make me think of NASA deep space missions, trying to upgrade the operating system of some spaceship a million miles away with no room for failure! Prerequisites: 1. you know how /etc/fstab, /etc/lilo.conf, fdisk, and lilo work. 2. you have already backed up mission critical data and made plans for failover, in the case something catastrophic happens. 3. in the event that you screw up, or I have omitted anything, you should have someone or some way to power cycle the remote machine. 4. I think this is already in the site disclaimer, but I'm not responsible for you frying your system. :) The answer: 1. make backups of your important data over the net 2. install parted -- http://www.gnu.org/software/parted/ or another ext2 resizing tool -- http://linux.msede.com/ext2/ 3. kill all unnecessary processes on your remote system and sync 4. swapoff your swap partition (we'll call that former partition "swap") 5. use fdisk to change "swap"s partition type to linux ext2, then mke2fs "swap" (or some partition thereof, if you have plans for that space) 6. mount "swap" 7. cp -a enough of your base linux system to "swap" to accept incoming ssh traffic, and of course to contain your newly installed tools. This will probably include files in /bin /sbin /etc /lib /usr /boot /dev /var. You don't need to copy user data, old logs from /var, or /home, as long as your sshd will allow you to log in directly as root. You will want to make an empty /tmp directory, though, as some programs/daemons need this. If you find you don't have enough space in "swap" try to exclude things like /usr/x11r6, /usr/local, /usr/src/<linux kernel sources>, /opt, etc... 8. modify the fstab in "swap" to reflect root (/) residing in "swap" 9. add this new root partition and it's "swap"/boot/vmlinuz as a new entry in /etc/lilo.conf called "swapsys" on your current root, and run lilo 10. run lilo -R swapsys to make your system attempt a boot from this new partition on your next boot. 11. sync and unmount or remount -oro "swap" 12. shutdown -r now to reboot your system remotely. if you configured the swapsys system correctly, the system should come back up using "swap" as it's root 13. you are now free to use parted or another utility to resize the now unmounted root partition, and create new partitions with fdisk 14. manually e2fsck -f your new/resized partitions 15. mount the original root and your new partition(s) off of /mnt 16. modify the original root fstab as appropriate for your new partition(s) 17. modify your current swapsys root's lilo.conf to to make your swapsys the default boot (cause you know it works now) and make your newly resized root "original" 18. run lilo, then lilo -R original 19. sync and unmount or remount -oro the original root 20. shutdown -r now 21. your system should come back up on the original (but resized) root 22. edit lilo.conf to make the original root your primary 23. run lilo 24. use fdisk to change "swap"s partition type back to swap 25. mkswap "swap", and swapon "swap" 26. do one last pass through fstab to check things and add "swap" back in 27. reboot a final time, because if you have been careful and gotten this far, you know your system will come back up. |
Subject:
Re: Remotely Resizing Partitions in Redhat 7.1 or 7.2
From: philip_lynx-ga on 26 Jul 2002 00:42 PDT |
parted and resize2fs -- I certainly learned something here. Time does move on, and software does get better (or at least more powerful). Thanks to all! ;-) |
Subject:
Re: Remotely Resizing Partitions in Redhat 7.1 or 7.2
From: bcw-ga on 01 Aug 2002 10:34 PDT |
LVM - Logical Volume Manager http://www.sistina.com/products_lvm.htm http://www.sistina.com/lvm_howtos/lvm_howto/ I think this only works if you already had it installed but worth looking at to see if it will work for you now. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |