LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2009, 01:08 PM   #1
foampile
Member
 
Registered: Feb 2009
Posts: 50

Rep: Reputation: 15
how to reallocate space between partitions/devices ?


this is what my 'df -h' says

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 2.0G 2.0G 0 100% /
none 851M 0 851M 0% /dev/shm
/dev/sda2 147G 188M 140G 1% /mnt


i would like to move some space from sda2 to sda1. is there a way to do it ?

thanks.
 
Old 02-26-2009, 01:16 PM   #2
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
sure, however just a question, you have a drive mounted as /mnt ?
i wouldn't recommend that as /mnt is a directory for creating mount points but isn't intended to be a mount point itself, yes you can mount a volume as /mnt as you already have, any directory with the exception of /root can be a mount point but that doesnt mean it should be one, i would create a directory under /mnt such as /mnt/something and edit the /etc/fstab to point /dev/sda2 to /mnt/something instead
note, /root (user root's home directory) is an exception as it has to be on the same partition as the system in case you have to boot without the other partitions mounted you can gather utilities in root's home to use to restore functionality and you can't do that if /root is a separate partition

replacing something with a name that is descriptive of what you put there

for instance if you have alot of music, you could mount it as /mnt/music and move your music files there
or alot of music and video make it /mnt/media and put your music and video files there
or for just plain files /mnt/storage and put your files there
etc...

after that it is just a matter of locating files you want to put there and using your favorite file manager to move them there or at a prompt, mv - *files* /mnt/something/

that should free up space

Last edited by frieza; 02-26-2009 at 01:19 PM.
 
Old 02-26-2009, 01:31 PM   #3
foampile
Member
 
Registered: Feb 2009
Posts: 50

Original Poster
Rep: Reputation: 15
it's like that because i didn't really configure it all myself. this is an instance of an image from Amazon Elastic Compute Cloud.
 
Old 02-26-2009, 02:07 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by foampile View Post
it's like that because i didn't really configure it all myself. this is an instance of an image from Amazon Elastic Compute Cloud.
Just a bit more detail is going to be needed here......

Please describe the overall situation and what you are trying to do. As part of this, tell us what your hardware is--hard disk, RAM, etc.---and how and why you are installing this image.

Also, I doubt that I am the only one who does not know what is the "Amazon Elastic Compute Cloud".
 
Old 02-26-2009, 02:11 PM   #5
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
either way, it may be just as easy as moving a few files into the directory that the other partition is mounted as and use them from there
always try the most conservative approach first
 
Old 02-26-2009, 03:29 PM   #6
foampile
Member
 
Registered: Feb 2009
Posts: 50

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pixellany View Post
Also, I doubt that I am the only one who does not know what is the "Amazon Elastic Compute Cloud".
http://aws.amazon.com/ec2/
 
Old 02-26-2009, 03:43 PM   #7
foampile
Member
 
Registered: Feb 2009
Posts: 50

Original Poster
Rep: Reputation: 15
dudes, i don't have anything under /mnt except for lost+found, i just need the command to reallocate the space.
 
Old 02-26-2009, 03:44 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by foampile View Post
Very interesting, but it does not answer my other questions.....
 
Old 02-26-2009, 04:38 PM   #9
foampile
Member
 
Registered: Feb 2009
Posts: 50

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pixellany View Post
Very interesting, but it does not answer my other questions.....
since it is a server hosted somewhere else, i guess i don't have access to that kind of info. the OS is Fedora 9.
 
Old 02-26-2009, 04:42 PM   #10
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Quote:
Originally Posted by foampile View Post
dudes, i don't have anything under /mnt except for lost+found, i just need the command to reallocate the space.
all you have to do is move files into that directory, the rest takes care of itself


open a file manager such as nautilus or konqueror with 2 windows
navigate one window to /mnt
navigate another window to a directory where you keep say.. your music or videos
move the files, it's a simple cut/paste operation in a gui file manager
it's that simple
or if you prefer command line
cd to a directory that contains files such as music and mv them to /mnt

Last edited by frieza; 02-26-2009 at 04:44 PM.
 
Old 02-26-2009, 04:45 PM   #11
foampile
Member
 
Registered: Feb 2009
Posts: 50

Original Poster
Rep: Reputation: 15
dude, there is no files involved. it is like reallocating partition space.
 
Old 02-26-2009, 04:49 PM   #12
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
how are there no files involved?

files occupy space on a volume if a volume is full you can't put more files

/mnt is simply a pointer to a separate volume which is empty

in windows it would be the equivilent of a separate drive letter (e.g. d: )

moving files such as music or media files (which occupy space on your volume) to /mnt will unallocate the space they occupy on that volume and reallocate them to the other volume

nothing more or less to it

Last edited by frieza; 02-26-2009 at 04:52 PM.
 
Old 02-26-2009, 04:54 PM   #13
foampile
Member
 
Registered: Feb 2009
Posts: 50

Original Poster
Rep: Reputation: 15
i know but in windows you would have to repartition the disk to redistribute space between different drives. if c: has 8G and is full and d: has 20 and is half empty, you need to repartition to give some of d's space to c. it is not as simple as copying files.
 
Old 02-26-2009, 05:01 PM   #14
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
ok, that's a little more descriptive of what you want
first backup your files in case something goes wrong
then use gparted to edit your partitions
however since your / volume is full you will still have to move files off of it first to make room for installing gparted if it isnt already installed
you can also try a live cd distribution that comes with gparted such as backtrack

Last edited by frieza; 02-26-2009 at 05:03 PM.
 
Old 02-26-2009, 05:22 PM   #15
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You mentioned this is to be used as a server. What kind of server?

What is the purpose of /dev/sda2? You could copy all of the files from /usr or /var (e.g. sudo cp -aR /var/* /mnt/ ) and when it is finished, delete the files in /usr; umount /mnt and mount /dev/sda2 on the /usr/ directory instead.
In this way Linux is different than windows. All of the partitions are mounted on a directory. There is only one root directory (/) that contains the mountpoints. E.G. mounting a partition on /home, or on /mnt/disk/. By moving the files in /usr, you are freeing up space. By mounting /dev/sda2 on /usr, the files will appear to be the same place they were before the changes. But they exist on another filesystem on /dev/sda2.

For a server, there may be a large /var/srv or /var/www directory. If that is the case, copying the data from /var/ might be a better idea.

---
2 GB is not very much at all. A program like gparted can resize partitions, but you will need to do it from a live distro.
Are you sure you aren't in the install environment? Is this a remote server running in a VM? For a desktop system, Fedora will by default create a /boot, swap and an LVM2 partition.

For a server, you want /tmp, /var and if it exists /srv on separate partitions, or at least not a part of root. Someone could easily file up /var/log/ with logs. This will cause fewer problems if the logs aren't in their own partition.

The /usr/ partition tends to be very large. For a workstation or a server with regular users, /home will be the largest partition. /usr will be the second largest and grow slowly with time as you add more software. For a general purpose file server, perhaps /var/samba will be the largest. For a web server, /var/http.

The /bin/, /sbin/, /etc directories won't contain as much and for a server, you won't install much software anyway. These can stay on the root (/) directory.

Last edited by jschiwal; 02-26-2009 at 05:24 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HD Space / Partitions Verbal Kint Linux - General 1 01-27-2006 10:05 PM
FDISK! /var too big; / too small, reallocate disk space pauljtester Linux - General 2 08-05-2004 08:10 PM
How to resize a partition or reallocate space? Avatar Linux - Newbie 12 04-22-2004 04:11 PM
I need to reallocate drive space from mount point / to /boot decampbell1 Linux - Newbie 7 01-08-2004 02:34 PM
How much space is need for Partitions? den_santiago Linux - Newbie 1 10-06-2002 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:56 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