Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making big ones out of little ones [was: tlug: Debian install...]



> Dont think any step is missing in Stephen's example.

I guess still have problems with simulating this with my biological, rather 
limited CPU. 

> >  <stephen>
> >  
> >  Eg, I'm looking at a 1GB partition
> >  mounted on /usr, and that's just not going to cut it if Debian keeps
> >  adding packages at the current rate.  So I can add 33% free space to
> >  that partition by creating a 500MB partition somewhere (say
> >  /dev/sdb1), formatting it, mounting it to /tmp/share, copying
> >  /usr/share recursively to /tmp/share, then adding
> >  
> >  /dev/sdb1 /usr/share ext2 defaults 0 2
> >  
> >  to /etc/fstab, and doing `diff -rq /usr/share /tmp/share >
> >  /tmp/just-for-grins' to make sure everything's OK before doing rm -rf
> >  /usr/share; mkdir /usr/share; umount /tmp/share; mount /usr/share.
> >  
> >  </stephen>

I thought after this  /usr/share is empty but mounted and /tmp/share is not 
available anymore including its data, but this is probably not the case, I am 
confused ... So by mounting empty /usr/share everything under /tmp/share is 
magically moved to /usr/share, since it is physically on /dev/sdb1? Or is this 
the point after which I should move /tmp/share to /usr/share? But 
since /tmp/share is umounted, how will it be found? Or should I 
move  /tmp/share to /usr/share after having deleted the old /usr/share, instead 
of mkdir /usr/share? No, I guess somehow /tmp/share gets renamed by 
mounting /usr/share, is that correct?

I will now test what yout wrote about swapping with a little adjustment 
since /var is full and there is still plenty of room on /usr ... if anything 
goes wrong I just install everything from the beginning and mount it correctly 
from the start. But it's all very interesting .... taihen benkyoni narimashita.

Arigatou, Uli

> Still, here is one way to do the swapping. 
> Say, /dev/hda2 is mounted on /usr and /dev/hda3 on /var. You want to
> swap the data on these two partitions and then swap their mount points,
> right?
> 
> Boot to single user mode.
> Now move the present contents of /var to /var/varcopy :
> 
> cd /var 
> mkdir varcopy 
> mv * varcopy
> 
> 'mv' may print out some error like varcopy cannot be moved to varcopy
> --- it is nice on the part of mv not to do that, so be happy..
> 
> Now you have nothing in /var except one directory /varcopy. we will
> later copy that to /usr. 
> 
> Recursively copy the contents of /usr to /var :
> 
> cd /usr
> cp -a * /var
> 
> If you are paranoic, check that everything is copied. I think it's
> overkill to run diff on all files, but may be you can run diff on the
> outputs of 'ls -lR /usr' and 'ls -lR /var'. Be prepared to find some
> differences like the time stamps on symbolic links.
>    
> Then delete all that's on /usr and copy varcopy/* to /usr:
> (guess deleting /usr cant break the hell loose ...?)
> 
> cp -a /varcopy/* /usr
> 
> Now edit /etc/fstab to swap the entries for /usr and /var
> (ie . mount /dev/hda3 on /usr and /dev/hda2 on /var. ) and reboot.
> Viola ! 
> 
> (Actually you dont have to reboot, only umount /usr and /var and
> remount them as per the new fstab, but rebooting cant hurt.. )
> 
> 
> 
> 
> "Was it a vision, or a waking dream 
>  Fled is that music, do I wake or sleep "
> 
> i'm half asleep --- sure, no guarantees to  have got it right.. 
> 
> Selva
> 
> 
> 
>


--------------------------------------------------------------------
Next Nomikai Meeting: April 20 (Thu) Linux Conference 2000 Spring Ed.
Next Technical Meeting: May 13 (Sat) 13:30 Temple University Japan
* Topic: TBD
--------------------------------------------------------------------
more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links