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...]





On Thu, 20 Apr 2000 ulrike@example.com wrote:

>  <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>
>  
>  OK, how about this scenario: I tried to install some packages with dselect, and 
>  before it is finished the drive on which I mounted /usr is 100% full ( which 
>  confirms my fears about my partitioning). On the other hand the much larger 
>  drive on which I mounted /var is only 2% full, so I would like to change this, 
>  swap them if possible. Now before I screw up my not yet really existing system 
>  if possible I would like to have a confirmation about the following strategy: I 
>  move /usr to /tmp/usr assuming that /tmp is on the same drive with / which would 
>  have enough room. Then I exchange /usr and /var in fstab .. ??? No - err - error 
>  - ??? I won't solve it today, what is the solution? And isn't something missing 
>  in the example above? Some moving of files at some point?

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

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