basile@soleil.cea.fr (Basile STARYNKEVITCH) (06/05/91)
In reply to Sun-Spots Digest, v10n86 Date: Sun, 21 Apr 1991 16:26:37 GMT From: jacquier@gsbsun.uchicago.edu (Eric Jacquier) Subject: How to increase the size of the /usr partition? X-Art: Usenet #14 You need to make a new file system in a changed partition of a disk. This means you lose its (previous) content. In your case, you will lose (and restore) your /usr !!. The problem is that you do need this /usr partition to make a new file system. (you need /usr/etc /usr/bin /usr/lib). If you could mount (temporarily) /usr from another sun4c server, you could manage. Otherwise, you could copy a tiny /usr system into an unused partition (e.g. your previously dumped /home) and then mount it... All that is tricky (and risky..) So, first of all, you have to backup your disk (with a full dump). /usr/etc/dump ... (I strongly suggest a full disk dump (of /usr and /home...) Then, copy a minimal stuff (into unchanged root partition) to be able to restore:: # cp /usr/etc/restore /sbin/restore # cp /usr/etc/dump /sbin/restore # cp /usr/bin/tar /sbin/tar # cp /usr/bin/mv /sbin/mv # cp /usr/bin/ln /sbin/ln now, remount /usr by rebooting boot /vmunix -asw or by # /sbin/mount -v newusr /usr ## newusr is server:/usr or a /dev/rsd0h or something) (NB: these should all be statically linked programs) Once you have changed the partition of your disk (with: # format sd0 format>partition format>g ### change /usr partition, etc ... format>label format>quit ) Now make a new file system on your changed partition. This build up the inodes, etc... # /usr/etc/newfs /dev/rsd0g And then restore the saved /usr stuff # /sbin/restore .... Then reboot your system If anything fails, you have to make a full reinstall... You can't shrink the swap partition easily (i.e. you have to use the MINIX stuff on boot tape) - because there may be some processes currently swapping on the lost portion of shrinked swap partition. But you could avoid a full reinstall by copying dump stuff into sbin, and then restoring.. (restoring is faster than reinstalling). However, you can easily grow the swap partition... I did make such a tricky stuff (changing /usr partition..) by temporarily NFS mounting /usr - maybe some details are wrong, so be careful !!