LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   How many partitions can I mount to / ? (https://www.linuxquestions.org/questions/linux-hardware-18/how-many-partitions-can-i-mount-to-474660/)

rushy2uk 08-17-2006 02:49 AM

How many partitions can I mount to / ?
 
I'd like to add more capacity to the root of our Suse server, as it only has 85MB left, and certain applications say the Operating System has throw an "out of space" error.

I have an unused partition, but I'm not sure if I'm allowed to mount it to "/", or even if it's possible.

How can I add the spare 20GB from partition sda2, to the root of the filesystem ( / ), without deleting existing files?

acid_kewpie 08-17-2006 03:10 AM

you can't add space to the / partition, what you'd actually do is attach an additional partition to take over for a particular subdirectory that exists on that partition, e.g. /usr, /var /home... often it's a simple case of just mounting the new partition in a temporary location , e.g. /mnt/usr and then doign a recursive copy of what you want it to be, e.g. "cp -r /usr /mnt/usr" then it's just a case of mounting it and you should be done. not really done though, as that old data will stilll be on the original drive,. but once you're happy with it, drop to single user mode (run "init 1") and unmount the new partition to expose the old files. then just delete the files (or rename the directory for evan more security, e.g. from /usr to /oldusr. then create a new /usr directory that's empty). then mount the new parition again and you'll have all the extra space.

rushy2uk 08-17-2006 03:38 AM

Thanks for the advice Chris.
I don't need extra space for the /home directory, as there is currently 23GB spare.

Can you suggest another subdirectory that gets large?
Or can you tell me how to search for large files, so I can find out myself?

acid_kewpie 08-17-2006 03:41 AM

my favourite way is to change to / and run "du -h --max-depth=1" this will then list the size of all directories there so you can plan your attack that way. also don't overlook the potential that you've lost space from other causes than simply installing more stuff, there are many ways to lose a lot of space that you should otherwise have reclaimed...

jschiwal 08-17-2006 03:57 AM

Be sure to look through your /etc/fstab file. Some system directories such as /usr, /var or /tmp might make good candidates to be relocated on your spare partition. Depending on how much software you have installed, the /usr directory tends to be the next largest partition after /home, and might make a good candidate for moving.

Take a look at "du -sh /usr" to see how much space it occupies.

One thing that is very common in servers is to have a dedicated partition for /var. The /var/logs directory can get full sometimes, and having a separate /var partition can prevent a hacker from filling up your root directory due to large logs being generated.

rushy2uk 08-17-2006 03:59 AM

So far, so good!
I used that command and headbutted the monitor as I saw 16GB next to the /marketing directory; I literally copied a load of stuff from our old NT4 server the other week (my memory is sooo poor!).

Right, so let me get this clear.
The next steps should be:
  1. Create a temp folder eg "/marketingNew".
  2. Mount sda2 to /marketingNew.
  3. Copy all existing data from /marketing to /marketingNew.
  4. Delete all data from /marketing, then remove /marketing directory.
  5. Rename /marketingNew to /marketing.
  6. Make sure the share name is the same as before.
Does that sound right?

Quote:

Vampire Robonurses hunt in packs
Nice statement, but wrong. I just saw a lone Vampire Robonurse hoover past my window!!

acid_kewpie 08-17-2006 05:45 AM

yeah those steps are just about right, and by the look of it this is human data, not application data, so you can chuck it around as you wish. so one thigns i'd add is to rename the directory, don't delete it. just to be on the safe side. delete it once you know everythign is running just fine.

rushy2uk 08-17-2006 05:52 AM

Quote:

Originally Posted by acid_kewpie
yeah those steps are just about right, and by the look of it this is human data, not application data, so you can chuck it around as you wish. so one thigns i'd add is to rename the directory, don't delete it. just to be on the safe side. delete it once you know everythign is running just fine.

Excellent, thanx for your help Chris....much appreciated.

p.s I just saw another lone Vampire Robonurse hoover past my window!! Maybe you should update your signature to say "Vampire Robonurses *mostly* hunt in packs", lol!

acid_kewpie 08-17-2006 06:29 AM

http://www.theregister.co.uk/2005/06...re_robonurses/

rushy2uk 08-17-2006 10:43 AM

I have one more question.
I'm having problems unmounting sda2; an error message says "permission denied'.

How can I unmount sda2 from /test?

Quote:

Originally Posted by acid_kewpie

Ah, I didn't read that one...but I'm familiar with the "Lizard Alliance", lol!

I love theregister! I scour through the stories every lunchtime and chuckle at the style of the witty writers...comedy!


All times are GMT -5. The time now is 07:11 PM.