From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,2ed5793b8eedb52b X-Google-Attributes: gidfee84,public From: "Adam Price" Subject: Re: How to Move Root(/) to Alternate Drive? Date: 1999/03/29 Message-ID: <922732652.20159.0.nnrp-12.c2deb51d@news.demon.co.uk>#1/1 X-Deja-AN: 460435134 Content-Transfer-Encoding: 7bit X-NNTP-Posting-Host: pappnase.demon.co.uk:194.222.181.29 References: <36ff9402.460612909@news.mtt.net> Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 922732652 nnrp-12:20159 NO-IDENT pappnase.demon.co.uk:194.222.181.29 Organization: none MIME-Version: 1.0 Newsgroups: comp.unix.osf.osf1 John Allen wrote in message <36ff9402.460612909@news.mtt.net>... >Hi: > >Is there a resonably uncomplicated method of changing the >location(drive) for the root(/) dir? > >I presently am running 3.2C with the root on my 1GB drive. > >I'd like to move my root to my 2GB drive. > >Other than a system re-install, is there another way to do this >safely? > >Thanks, > >John L. Allen OK Here goes. 1G drive has scsi ID 0 on bus 0, and uses a standard partition layout. 2G drive has scsi ID 1 on bus 0, is empty and has not been in the machine before. At the console prompt: >>> boot -flags s -file vmunix This will boot to single user mode. When in single user mode # fsck / # Check the root filesystem # bcheckrc # Check and mount other filesystems in /etc/fstab # swapon -a # Turn on swapping # cd /dev # ./MAKEDEV rz1 # create special devices for rz1 # cd /tmp # disklabel rz1 > rz1.safe # save current rz1 disklabel in a file, it is ok if this fails, # but it is always better to be able to undo something if you can. # disklabel -z rz1 # wipe current disklabel # disklabel -rw rz1 rz1 # write default disklabel and bootblocks on rz1 # disklabel -e rz1 # edit disklabel (editor chosen based on $EDITOR or vi if unset). # newfs /dev/rz1a # write filesystem on new partition. # mkdir /newroot # mount /dev/rz1a /newroot # mount new root partition. # vdump -0f- / | (cd /newroot && vrestore -xf -) # copy root partition. # sync # cd /newroot/etc # sed 's/rz0a/rz1a/' fstab >fstab.new # change fstab on new disk. # mv fstab.new fstab # cd / # umount /newroot # init 0 This should take you back to the chevrons boot the new disk using, >>> boot dka100 This should boot from your new disk into whatever runlevel you normally get. If this works then on many of the alphas you should change the console variable bootdef_dev to dka100, which will change the default boot device. If you want to move /usr then you can use a similar technique. Hope this helps Adam