Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After several attempts to formalize my problem, I think, I finally managed to do it.

What I have:

mount -l    
...

/dev/md123 on / type ext3 (rw,noatime,errors=continue,user_xattr,acl,barrier=0,data=ordered)
/dev/md121 on /home2 type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
/dev/md125 on /h1 type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
...


cat /proc/mdstat    
...
md121 : active raid1 sde2[1] sdf2[0]
      293065664 blocks [2/2] [UU]

md125 : active raid1 sdc7[0] sdd7[1]
      20659456 blocks [2/2] [UU]

md123 : active raid1 sdc2[0] sdd2[1]
      2939776 blocks [2/2] [UU]
...

fdisk -l

...
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          63     1606499      803218+  fd  Linux raid autodetect
/dev/sdc2         1606500     7486289     2939895   fd  Linux raid autodetect
/dev/sdc3         7486290    11406149     1959930   fd  Linux raid autodetect
/dev/sdc4        11406150    72292499    30443175    5  Extended
/dev/sdc5        11406213    27053459     7823623+  fd  Linux raid autodetect
/dev/sdc6        27053523    30973319     1959898+  fd  Linux raid autodetect
/dev/sdc7        30973383    72292499    20659558+  fd  Linux raid autodetect
...
   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *          63     1606499      803218+  fd  Linux raid autodetect
/dev/sdd2         1606500     7486289     2939895   fd  Linux raid autodetect
/dev/sdd3         7486290    11406149     1959930   fd  Linux raid autodetect
/dev/sdd4        11406150    72292499    30443175    5  Extended
/dev/sdd5        11406213    27053459     7823623+  fd  Linux raid autodetect
/dev/sdd6        27053523    30973319     1959898+  fd  Linux raid autodetect
/dev/sdd7        30973383    72292499    20659558+  fd  Linux raid autodetect
...
   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1              63   390636539   195318238+  fd  Linux raid autodetect
/dev/sdf2       390636540   976768064   293065762+  fd  Linux raid autodetect
...
   Device Boot      Start         End      Blocks   Id  System
/dev/sde1              63   390636539   195318238+  fd  Linux raid autodetect
/dev/sde2       390636540   976768064   293065762+  fd  Linux raid autodetect

The problem to solve:

h1 contains only email-users homedirs(with Mailbox directory for mails).

I want to move h1 directory under home2. So it would be /home2/h1 AND I want to remove /dev/md125, so all available space from it would go to /md123.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Unfortunately this can't be done without a lot copying files between locations - so a solution would really require knowledge of how full each filesystem is (df may tell you this. We would also need to move stuff around on other partitions - eg stuff on sdc1, sdc3, sdc5,sdc6 and the equivalent sdd partitions if they are not mirrored).

You have a couple of problems which make it impossible to just merge partitions -

  1. You are not using LVM (Logical Volume Manager), which would allow you to resize stuff dynamically.

  2. md121 and md123 are not on back-to-back partitions, so you can't merge the space.

The ideal solution would be to backup everything on sdc and sdd, then repartition them as single large partitions and RAID1 them, and then run LVM on top of the RAID array to allow you to create partitions (which you can then resize, delete, snapshot, add more disk to etc without worrying about where stuff is stored on the physical disk).

It is possible to "move" h1 under home2 simply my creating /home2/h1, unmounting /h1 and remounting it as /home2/h1 - you can do this "permanantly" by editing /etc/fstab.

share|improve this answer
    
Yeah. What is what I feared of. It can't be done so easily as I thought. Ty. –  Jevgeni Smirnov Feb 14 '13 at 10:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.