LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-23-2005, 01:04 PM   #1
marc1978
LQ Newbie
 
Registered: Oct 2005
Location: Ottawa in Canada
Distribution: Mandriva 2005 LE (10.2)
Posts: 13

Rep: Reputation: 0
Question Need suggestions on creating proper file systems


New install of Mandriva 2005 LE.
Here is the result when doing a fdisk -l

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 764 6136798+ 83 Linux
/dev/sda2 765 19452 150111360 5 Extended
/dev/sda5 765 904 1124518+ 82 Linux swap
/dev/sda6 905 19452 148986778+ 83 Linux

And the result of doing a df command:

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 5.8G 4.1G 1.5G 75% /
/dev/sda6 140G 601M 140G 1% /home

Now I guess my question is how can I and how should I modify this so that my "/" wil now get full. (as you can see , there's only 1.5G available and 140G on my /home.
Overall, how does this look to you? Any suggestions appreciated.

Thanks
Marc
 
Old 10-23-2005, 01:24 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look at the result of "du -h /usr

The /usr directory is where new software you add thes installed to. It is probably the largest non-home directory, and it will grow with time. Consider shrinking your home partition and make a new partition for /usr in the space you freed up, and move the contents of /usr there.

This should free up a lot of space in your root (/) partition.
 
Old 10-23-2005, 01:25 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
On my system, I've created five partitions:
/
/home
/usr/local
/var
swap

/home is a separate partition for obvious reasons: easy to keep across a distro change or upgrade - no loss of user settings

/usr/local is separate for similar reasons. A distro is not supposed to touch anything in /usr/local, but I don't know how faithfully the distros follow this. Regardless, it keeps any stuff I have added separate from the system.

/var is a separate filesystem since it contains the logs. If this filesystem runs out of space, the whole system doesn't come crashing down. It just means I don't get anymore log information until something gets freed up.
 
Old 10-23-2005, 03:41 PM   #4
marc1978
LQ Newbie
 
Registered: Oct 2005
Location: Ottawa in Canada
Distribution: Mandriva 2005 LE (10.2)
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for these suggestions.

Can you just give me the steps on how to move the files to the new partittion? Do I simply do a "mv" ?
 
Old 10-23-2005, 05:25 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Using 'cp -a /usr/* /usr-new' would probably work better.

The /usr directory may be needed while Linux is running. First mount the new partition under a different name. If you have it mounted as /usr to start, you will mount over the old /usr directory and won't be able to copy the files.

You could perform these steps as root:

1) create a new directory: mkdir /usr-new
2) mount the new directory at /usr-new: mount -t ext3 /dev/hda7 /usr-new # Here I am assuming /dev/hda7 and ext3 filesystem.
3) copy the directory: cp -a /usr/* /usr-new
4) edit the /etc/fstab entry. Add an entry for /usr at /dev/hda7:
/dev/hda7 /usr ext3 acl,user_xattr 1 2

note: You might want to copy the fstab line for /home as a model, and change the device and directory fields. The device field should be the device of the new partition and the directory field should say /usr. (I'm assuming /dev/hda7)

Next we will need to change the name of the /usr directory so that we can have a new /usr partition mounted. We don't want the new partition mounted over the current /usr because that will hide the directory contents we want to delete.
mv /usr /usr-old # This just renames the directory, it doesn't move the contents.
mkdir /usr # This is the directory for /usr that will be mounted over by the contents of the new partition.
mount -t ext3 /dev/hda7 /usr # Now we have the new partition acting as /usr (in this shell at least)
rm -R /usr-old # Remove the old contents to free up space.

note: Using "rm -d /usr-old" or "unlink /usr-old" may be quicker. If it works on your system, it will remove the directory entry for /usr-old and not recursively delete every file of its contents.

Lastly cross your fingers and reboot: /sbin/shutdown -r now

Good Luck.

P.S.
a) Before you do these steps it may be better to log out of KDE. Then go into single user mode. For Mandrake this is "telinit 1".
b) For step 3, consider using a "tar" command similar to the example given at the end of the info tar manual to copy the files.
#> cd sourcedir; tar -cf - . | (cd targetdir; tar -xf -)

Last edited by jschiwal; 10-23-2005 at 05:46 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
creating partitions and file systems on Solaris 8 ashlesha Solaris / OpenSolaris 7 05-26-2005 01:38 AM
Is arrangement of file systems will differ if we copy a file from FAT 32 to ext 3 ? anindyanuri Linux - Software 2 02-20-2005 11:39 AM
Where to find the proper log file? mykrob SUSE / openSUSE 1 10-27-2004 10:12 AM
How do i find the proper linux config file? justinfl General 2 10-08-2003 11:01 PM
'Proper' file and directory permissions etherdeath Linux - General 5 03-02-2003 03:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration