0

I have following filesystems on my Ubuntu 12.04:

u@czarnobog:~$ df -hT
Filesystem          Type      Size  Used Avail Use% Mounted on
/dev/mapper/md1-md1 ext4       31G   27G  2.7G  91% /
udev                devtmpfs   16G  4.0K   16G   1% /dev
tmpfs               tmpfs     3.2G  428K  3.2G   1% /run
none                tmpfs     5.0M     0  5.0M   0% /run/lock
none                tmpfs      16G     0   16G   0% /run/shm
none                tmpfs     100M     0  100M   0% /run/user
/dev/mapper/md3-md3 ext4       97G   43G   49G  47% /export
/dev/mapper/md2-md2 ext4      7.7G  5.6G  1.8G  77% /var
cm_processes        tmpfs      16G  2.6G   14G  17% /run/cloudera-scm-agent/process

Is it possible to transfer some free space from one to another, for example 10 gigs from /dev/mapper/md3-md3 to /dev/mapper/md1-md1? Ideally without formatting and rebooting anything? Or some other way of increasing /home free space on this server?

Kranach
  • 123
  • 1
  • 1
  • 5

1 Answers1

1

Based on the file system list provided, I don't see any disk mounted at /home. This indicates to me that your home directories are currently mounted at /

If this is the case the solution is rather easy if you have a free port to mount another drive.

1) prepare a drive of the desired size formatted with the desired filesystem.

2) mount the prepared drive to a temporary location.

3) Insure that no one is currently using the existing /home (boot in single user mode or boot from a live media) copy the contents of the /home recursively to the temporary location you mounted the newly prepared drive to.

4) mount the new /home drive to /home

If any of this is unclear please leave a comment indicating what requires further explanation and I will expand the answer.

Granted this is not ideal as it requires both formatting and rebooting, but I've done it and it works.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • Yes, home is mounted on /, ideally i am hoping for some easy way of magically transferring 10GB from /export to /home. I would rather avoid rebooting this box, because it is not very stable and we critically need to have it working for another month before new hardware arrives. I guess in case of emergency we will go with your solution and install new drive - how to boot in 'single user' mode? – Kranach Feb 10 '15 at 18:15
  • That would seem to be a bit risky on unstable hardware with the file system mounted. Single user mode? See: http://askubuntu.com/questions/132965/how-do-i-boot-into-single-user-mode-from-grub – Elder Geek Feb 11 '15 at 20:00
  • @Elder geek: nearly perfect... I would have added "depending on your LVM set-up you can/cannot extend a running partition if and only if you did not allocate your disk entirely and left some spare (unallocated) space on your disk..." ;-) (Still worthy of an upvote as your method will work regardless of that condition) – Fabby Feb 12 '15 at 05:51
  • 1
    @Fabby Thanks for that. I'm all about what works. – Elder Geek Feb 12 '15 at 14:46