Saturday, November 20, 2010

In Unix, how do you change your root directory to a different drive?

run the ';df'; command to get a listing of mounted filesystems and use the ';cd'; command to get to them. For example, if another drive is mounted as /export, the ';cd'; command you run is ';cd /export.';In Unix, how do you change your root directory to a different drive?
You have to unmount the device mapped to root first - which means you need to be able to logout of all local user accounts first and basically shutdown the kernel. You need to then boot the machine from a different physical drive than the one you want to remap (a live cd/dvd would be ideal) so that none of the root filesystem is locked (part of it is always locked due to dev, proc and so on which are pseudo filesystems generated by the active kernel).



It's then a matter of creating a new root filesystem or copying the current one onto a different physical drive's filesystem and setting up the local machine to mount that device to /



The only thing you will have to take care of doing is to make sure you remount any other partitions you have to the same mount points. You'll have to update some configuration files, too but I don't know which ones you'd need for unix.

No comments:

Post a Comment