[newbie] Disk Free

2000-12-22 Thread poogle

When I installed 7.2 onto my 10gb HD, I selected the option to use the entire 
disk and the automatic option at the partition option, the result of "df" and 
"fdisk p" are below (note I mounted /dev/hda3 manually to obtain the result 
in fdisk), My question is :- it appears that I have the biggest part of my 
disk unused while / is nearly full, is there a safe way to utilise the rest 
of the disk i.e. can I safely resize/rename partitions and/or move /usr which 
is about 1.2gb ?

Filesystem   1k-blocks  Used Available Use% Mounted on
/dev/hda1  2063504   1631084327600  83% /
/dev/hda3   451902451902 0 100% /mnt/a  

   Device BootStart   EndBlocks   Id  System
/dev/hda1   * 1   261   2096451   83  Linux
/dev/hda2   262   293257040   82  Linux swap
/dev/hda3   294  1240   7606777+  83  Linux  

BTW, if anyone suggests partition magic as the solution, could they also tell 
me how to install/use it in a post-installation situation, thanks.




Re: [newbie] Disk Free

2000-12-22 Thread civileme

On Friday 22 December 2000 15:47, you wrote:
 When I installed 7.2 onto my 10gb HD, I selected the option to use the
 entire disk and the automatic option at the partition option, the result of
 "df" and "fdisk p" are below (note I mounted /dev/hda3 manually to obtain
 the result in fdisk), My question is :- it appears that I have the biggest
 part of my disk unused while / is nearly full, is there a safe way to
 utilise the rest of the disk i.e. can I safely resize/rename partitions
 and/or move /usr which is about 1.2gb ?

 Filesystem   1k-blocks  Used Available Use% Mounted on
 /dev/hda1  2063504   1631084327600  83% /
 /dev/hda3   451902451902 0 100% /mnt/a

Device BootStart   EndBlocks   Id  System
 /dev/hda1   * 1   261   2096451   83  Linux
 /dev/hda2   262   293257040   82  Linux swap
 /dev/hda3   294  1240   7606777+  83  Linux

 BTW, if anyone suggests partition magic as the solution, could they also
 tell me how to install/use it in a post-installation situation, thanks.

OK

I will assume you are in Some desktop

Open a terminal

$ su -
password:(give the root password)
# diskdrake
(You will now have a couple warning messages and then a window will open that 
allows you to partition the disk.)  The unused area will be shown in white.

Click on the white section and Create a partition--preference 'extended' on 
ALL these you create  say 1.5G for /tobeusr as the mount point and ext2 
(linux native) for the type.

If you are running servers make a /tobevar about 400M, otherwise 100M should 
do.

Make a /tobehome an appropriate size for the space you have remaining and the 
number of mp3s and pictures and word-processing files you want to store

If you have any other space left, and it is more than 200M, do a 
/tobe1usr/local...  And if not use the rest of the space as /tobetmp

Now hit each partition made in turn and click 'format'  then click 'Done'

# joe /etc/fstab   #you could use vi or jed or emacs or cooledit or pico too
Now in /etc/fstab you have new lines to type in

/dev/hda5 /tobeusr ext2 defaults 1 2
/dev/hda6 /tobevar ext2 defaults 1 2
/dev/hda7 /tobehome ext2 defaults 1 2
/dev/hda8 /tobe1usr/local ext2 defaults 1 2
/dev/hda9 /tmp ext2 defaults 1 2

Then you need to TRIPLE check your work for the added lines and save

Then the commands go as follows:

# mount /tobeusr
# cp -a /usr /tobeusr
# rm -r /usr -f
# ln -s /tobeusr /usr
# mount /tobevar
# cp -a /var /tobevar
# rm -r /var -f
# ln -s /tobevar /var
# mount /tobehome
# cp -a /home /tobehome
# rm -r /home -f
# ln -s /tobehome /home
# mount /tobe1usr/local
# cp -a /tobeusr/local /tobe1usr/local
# rm -r /usr/local -f
# ln -s /tobe1usr/local /usr/local
# rm -r /tmp -f
# shutdown -r now

This will have the following effects

1.  /usr is moved, making room
2.  /home is created so your data can be saved across installs (just don't 
format the /home partition)  Of course you must now print the /etc/fstab file 
to keep a record of your mount points.
3. /usr/local is the usual target of programs you download and install from 
other sources, so it is a nice thing to have separate (not trashed by 
installing version 9.5)
4. /var will have room to grow
5. No one will be able to use any of the exploits that overflow /tmp to put 
things into the root directory.

Those instructions must be done as shown.  An omitted instruction equals a 
broken system.  

What you are doing:

First you open the partition for dialogue with the system sing the mount 
command.

Second, you copy things from your current partition recursively, preserving 
all properties, ownerships, and links (that is the condition given by -a)

Third, you wipe out the old directory

Fourth you create a permanent link from old name to new mount point--you 
could avoid this by unmounting, editing the mount point name in /etc/fstab, 
then...  Well that's a lot more work, and it is time to learn that aliases 
and symbolic links are a heckuva lot more useful than shortcuts.

On /tmp, you simply remove the directory and let the reboot mount the new /tmp

Now you are going to have one heckuva big, mostly empty / partition, but you 
can always make use of it by, for example.

mkdir /mymp3s  #which would store the mp3s in the unused space in /.

Now, an exercise for the assiduous student.  Why did I not recommend 
splitting out into separate partitions the following:

/etc
/bin
/sbin
/lib

Hint:  What does the system do on boot?  It mounts / then does a few things, 
then remounts it R/W, then begins to mount other partitions.  What does the 
system need to know to do that?  What resources does it use?

Happy holidays BTW,

Civileme