how to reallocate space between partitions/devices ?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
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/
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".
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
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
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
Quote:
Originally Posted by foampile
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
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
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
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.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.