2

I am trying to install to install EPEL Repository on CentOS 5.7.

I still have lots of space available on my hard drive.

/dev/sda2             3.9G  3.9G     0 100% /
/dev/sda11             17G  2.9G   13G  19% /extra
/dev/sda10            996M   44M  901M   5% /logs
/dev/sda9             2.0G  670M  1.2G  36% /applications1

I just want to use some space from /extra so I can install mysql 5.5.20. Since I don't have physical access to this machine I cannot use CD and make partitions. There is no important data on this machine.

What is the safest way to do this.

This is the output of partition table

Model: VMware, VMware Virtual S (scsi)
Disk /dev/sda: 75.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  107MB   107MB   primary   ext3         boot
 2      107MB   4401MB  4294MB  primary   ext3
 3      4401MB  6547MB  2147MB  primary   ext3
 4      6547MB  75.2GB  68.6GB  extended
 5      6547MB  28.0GB  21.5GB  logical   ext3
 6      28.0GB  49.5GB  21.5GB  logical   ext3
 7      49.5GB  51.6GB  2147MB  logical   linux-swap
 8      51.6GB  53.8GB  2147MB  logical   ext3
 9      53.8GB  55.9GB  2147MB  logical   ext3
10      55.9GB  57.0GB  1077MB  logical   ext3
11      57.0GB  75.2GB  18.1GB  logical   ext3
Sven
  • 98,649
  • 14
  • 180
  • 226
vinny
  • 169
  • 1
  • 1
  • 6
  • 2
    Please post your partition table and tell us what file systems you are using. – Sven Feb 23 '12 at 19:59
  • What is the output of `fdisk -l`? – Aaron Copley Feb 23 '12 at 20:09
  • I just posted the partition table. @AaronCopley the out put is from df -h – vinny Feb 23 '12 at 20:18
  • There are some partitions there which are not listed in the mtab you posted. Plase post the full output of `mount`. – Massimo Feb 23 '12 at 20:22
  • 2
    What's on `/dev/sda3`? – Massimo Feb 23 '12 at 20:36
  • 2
    @Massimo, exactly my thoughts... And sda5,6,&8. – Aaron Copley Feb 23 '12 at 20:39
  • Something else to check: Is syslog really pointing to /logs? Or is /var/log filling up the root partition? – Aaron Copley Feb 23 '12 at 21:21
  • Unrelated side note: Please have a look at the formatting options. You can post unformatted text with the help of the `{ }` icon in the editor toolbar. More info here: http://serverfault.com/editing-help – Sven Feb 23 '12 at 23:36
  • Unfortunately, unless you can delete /dev/sda3, you're stuck. You would only be possibly able to grow root that way, by unallocating the blocks immediately after /dev/sda2, and then resizing /dev/sda2 to fit the gap with resize2fs. The whole process is more complex, but look at this tutorial, may be of help: http://www.howtoforge.com/linux_resizing_ext3_partitions – Yanick Girouard Feb 24 '12 at 01:12

3 Answers3

1

To be honest, you're going to be stuck here until you free up some space on /, or until you think of a way to chroot yourself in /extra. There are guides floating around on the internet on how to do that, since I've never actually done this myself.

That said, if you're using LVMs, you could resize / so that it's big enough to install some things on. However I don't think your setup has an LVM.

Also, I don't believe Yum can do relocatable packages (at least I've never needed to, someone feel free to correct me), and in this case it wouldn't matter until you at least free some space up on /. You could do a du -sch / to find begin finding out which directories you can delete from, though I don't think this would help since your / partition is small enough to presume that it's a basic install with a GUI on top.

qweet
  • 731
  • 5
  • 11
  • No, there might be a chance to avoid this if the partition table is laid out in a certain way and he can free partitions, but this will border to black magic and there is a significant chance for a disaster. – Sven Feb 23 '12 at 20:08
  • Good god man I hope you're not going to try and walk this fellow through an `md` setup D: – qweet Feb 23 '12 at 20:12
  • 2
    No :) I doubt that would be even possible on a running system, but what might work is to free some space adjacent to his `/` partition, then add this free space to `/` and grow the file system. As I said, it borders on black magic and there is good chance to kill yourself in the process ... – Sven Feb 23 '12 at 20:17
  • 2
    Rather than mess with root on a running system it's going to be better/safer to move /var or /usr to one of these other partitions that don't appear in use. – Aaron Copley Feb 23 '12 at 20:44
  • 1
    @qweet If you look at his `df -h` you can see he's not using LVM, otherwise you'd see mounts of /dev/dm-XX, not /dev/sdaXX. As others pointed out, growing a partition outside of LVM is always risky business! That said, whoever allocated only 3.9Gb to / deserves a slap behind the head for professional negligence! – Yanick Girouard Feb 24 '12 at 00:59
0

File installation paths are hardcoded in Yum packages, so you can't modify them; the only thing you can do is using the --installroot option to make Yum believe like it was chrooted:

yum --installroot=/extra install <packagename>

With this command, all paths for all files in the package will be relative to /extra instead of /; but this has a downside: if the package includes files meant to be installed in /usr, /etc, or any other system directory, they'll end up in subdirectories of /extra, and this will most likely not work as it should.

Your other option is to use rpm, which allows you to relocate packages.


As a side note, having a full or almost full root partition is definitely not a good thing, and is sure to bring you troubles sooner or later; you really should make it larger and/or free some space in it.

Massimo
  • 70,200
  • 57
  • 200
  • 323
0

Does anyone have physical access to this machine? Honestly, you're saving yourself a lot of headache if you change the partitions around now, versus when you have important data on it. If / is full before you start installing things, you're just going to have to deal with this issue over and over for the life of the server. It pains me to even think about the difficulties you are going to see.

devicenull
  • 5,622
  • 1
  • 26
  • 31