bigal

Member
Nov 10, 2009
14
0
51
If I use

WHM -> Account Functions -> Rearrange Accounts

and moved user from

/home/user to /home2/user

would the user need to change their website script (config file)?
for example Joomla configuration menu saves the
log and tmp path under the global configuration menu.
The values in there would still be /home/user
 
Last edited:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
It is correct that individual (add-on or custom) script configurations should be updated to ensure proper functionality with a new home directory path and or new username. A symbolic link from the old path pointing to the new path could also be used; however, in my professional opinion I believe this is more of a temporary workaround, allowing more time to update script configurations, rather than a long-term solution.
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
Don, yes, you're right; a symlink is only a short term solution really, I hadn't meant to imply that a symlink should be used rather than updating scripts to use the real home directory.

The best way to do that is to write path-independent code, of course. For instance, one could use the home directory from the environment, from a local config file, or from the "pwd" command, rather than hardwiring the "/home" or "/home2" string into scripts all through your site.
 

bigal

Member
Nov 10, 2009
14
0
51
I noticed that I can't rearrange account unless I have a new disk.
I loaded the new disk and set a mount /home2

In my test I rearrange a user from /home/user to /home2/user
now I want to rearrange the user back from /home2/user to /home/user
there is no option

The option displays
"Please choose a new mount point for this account: Sorry there is only one drive in this machine"

This is my df output
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
297513408 3912452 278244236 2% /
/dev/sda2 988116 17696 919416 2% /tmp
/dev/sda1 248895 18736 217309 8% /boot
tmpfs 1037744 0 1037744 0% /dev/shm
/dev/hdb1 38456308 217960 36284848 1% /home2

What happened there?
I can't rearrange back from /home2/user to /home/user
 
Last edited:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Rearrange an Account Function and home directory paths without a dedicated partition

I noticed that I can't rearrange account unless I have a new disk.
I loaded the new disk and set a mount /home2

In my test I rearrange a user from /home/user to /home2/user
now I want to rearrange the user back from /home2/user to /home/user
there is no option

The option displays
"Please choose a new mount point for this account: Sorry there is only one drive in this machine"

This is my df output
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
297513408 3912452 278244236 2% /
/dev/sda2 988116 17696 919416 2% /tmp
/dev/sda1 248895 18736 217309 8% /boot
tmpfs 1037744 0 1037744 0% /dev/shm
/dev/hdb1 38456308 217960 36284848 1% /home2

What happened there?
I can't rearrange back from /home2/user to /home/user
Via root SSH access, what is the output from the following command?
Code:
# mount
If the primary "/home" path is not its own partition and is instead just a directory located in the root file system then that may be why it is not being detected and displayed by the Rearrange an Account feature in WHM; this feature was designed to move accounts between partitions, not between directories. For reference, we are aware of the requested need for an enhancement of the existing feature and are tracking this via the following internal case ID: #4226

In the meantime a workaround is available. If there is no dedicated home partition and if it is just a directory, it is possible to manually trigger the rearrange action by using a WHM URI like the following that specifies the full directory path to your new mount point:
Code:
/scripts/dorearrange?mnt=/full/path&user=username
 

bigal

Member
Nov 10, 2009
14
0
51
mount ouptut is

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda2 on /tmp type ext3 (rw,noexec,nosuid)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/hda1 on /backup type ext3 (rw)
/dev/hdb1 on /home2 type ext3 (rw,usrquota)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /var/tmp type none (rw,noexec,nosuid,bind)

I understand now, thanks, there needs to be a /home partition mounted instead of home directory sitting in /

There is no such file in /scripts/dorearrange . This executable does not exist.
I also noticed a symbolic soft link was created from from Rearrange Account Function in /home/<username> -> /home2/<username.
 
Last edited:

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
mount ouptut is

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw,usrquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda2 on /tmp type ext3 (rw,noexec,nosuid)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/hda1 on /backup type ext3 (rw)
/dev/hdb1 on /home2 type ext3 (rw,usrquota)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /var/tmp type none (rw,noexec,nosuid,bind)

I understand now, thanks, there needs to be a /home partition mounted instead of home directory sitting in /

There is no such file in /scripts/dorearrange . This executable does not exist.
I also noticed a symbolic soft link was created from from Rearrange Account Function in /home/<username> -> /home2/<username.
To help clarify, the example URI is one that is used via WHM access; here is an example full URL, where "server" can be the server hostname, IP address, or a hosted domain name:
Code:
https://server:2087/scripts/dorearrange?mnt=/full/path&user=username
 
  • Like
Reactions: NabiKAZ