From: unruh@invalid.ca   
      
   On 2013-02-06, Aragorn wrote:   
   > On Wednesday 06 February 2013 16:59, Grimble conveyed the following to   
   > alt.os.linux.mandriva...   
   >   
   >> Unfortunately I have to move /usr to a new partition (I started to do   
   >> something with GNU Radio, and urpmi has been very busy!)   
   >> Would someone be kind enough to cast a critical eye over the following   
   >> to a) make sure I'm doing the right things   
   >> b) suggest something I ought to do.   
   >> I have created a new partition, sda12, currently with mount point   
   >> /newusr   
   >>   
   >> This is an extract from /etc/fstab:   
   >> # Entry for /dev/sda9 :   
   >> UUID=ac5349a0-8563-4a4e-b9ad-24a316cb309c / ext4 defaults 1 1   
   >> # Entry for /dev/sda12   
   >> UUID=3cef6111-eb18-4167-8390-821e6a4c43f9 /newusr ext4 acl,relatime 1   
   >> 2   
   >>   
   >> I propose to do the following   
   >> cd /usr   
   >> rsync -a */ /newusr # Keeps symlinks, times, owners, copies contents   
   >> of /usr   
   >>   
   >> edit /etc/fstab:   
   >> UUID=3cef6111-eb18-4167-8390-821e6a4c43f9 /usr ext4 defaults 1 2   
   >> Reboot to Live disk   
   >> mount /dev/sd9 /mnt/usr   
   >>    
   >>   
   >> Reboot to 2011 with fingers crossed.   
   >>   
   >> Thanks for your comments.   
   >   
   > I would suggest the following... First, drop down to single-user   
   > maintenance mode, i.e. runlevel 1 [*]. At this point, you are the root   
   > user - you may need to supply the root password, depending on the   
   > security level settings for your local system.   
   >   
   > A trick I've picked up from "The Definitive Guide To Mandrake Linux 9.2"   
   > is to use the following command, provided that the new filesystem is   
   > mounted where you say it is. ;-)   
   >   
   > (cd /usr && tar cf - .) | (cd /newusr && tar xpvf -)   
   >   
   > Next, proceed to editing /etc/fstab and delete the contents of the old   
   > /usr, as follows:   
   >   
   > cd / && rm -rf /usr/*   
      
   Aaarg. Not yet. Only delete the old stuff when you are SURE that the new   
   stuff works. It is so so easy to make a mistake and discover you never   
   copied over, say /usr/lib. If you erased it, you are screwed.   
   Just move it out of the way.   
   cd /&& mv /usr /usr.old &&mkdir /usr   
      
      
   >   
   > Next, put the new /usr filesystem in place in the tree...   
   >   
   > umount /newusr && mount /dev/sda12 /usr && rmdir /newusr   
   >   
   > Now you can return to your normal runlevel [*], and you didn't even have   
   > to reboot, let alone use a live/rescue CD/DVD. ;-)   
      
   Unfortunately while he talked about /usr all his examples were for /.   
   Sso I am not at all sure whether he wanted to replace /usr or his whole   
   / tree. If the latter, then he has a lot more work to do to make sure   
   that the system can boot up. Also, on newer systems, he will have to   
   dmake an new initrd since /usr is used in the boot process.   
   >   
   >   
   > [*] You will have to use the systemd-specific method for changing   
   > runlevels, as Mandriva isn't using the old System V init system   
   > anymore. I believe that...   
   >   
   > man systemctl   
   >   
   > ... could possibly shed some enlightenment on the situation. ;-)   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|