Moving / mountpoint
paul at city-fan.org
Wed Aug 17 09:54:05 UTC 2005
Garry Harthill wrote:
> On 17/08/05, Paul Howarth <paul at city-fan.org> wrote:
>>Garry Harthill wrote:
>>>I want to move all data currently on the / mountpoint to another disk
>>>and then remove the old data. (i just bought a faster disk)
>>>Is this a simple matter of putting the new disk in. Mounting it
>>>somewhere. Copying data to the new drive. Altering fstab to point / to
>>>/dev/hdc2 (for example) then rebooting? Is there anything else i need
>>>/boot is mounted on another partition on the slow first disk and will
>>>be staying. What changes will be needed to grub.conf. At the moment i
>>>have "root=LABEL=/". What does this need to be changed to?
>>If /dev/hdc2 is the new root, you'd want "root=/dev/hdc2"; the "LABEL="
>>syntax instructs the kernel to read the filesystem labels to find the
>>root partition. Alternatively you could create the new root filesystem
>>with a different label (e.g. "newroot") and then change the grub.conf
>>entry to have "root-LABEL=newroot".
> Will i need to copy the present root to the new partition from a
> rescue disk because of open files, etc? Or can it be done at full
> runlevel 3? I haven't used the rescue disk very much. Will it mount
> everything in /etc/fstab rw or will i have to do this manual?
It'll mount the partitions using the options specified in fstab I
believe (I may be wrong though - I hardly ever use the rescue disk).
I'd suggest making the partition on the new disk the same size or bigger
than the old root partition and then using "dd" to copy the actual
partition across rather than mounting the filesystem and using a regular
copy tool. This will ensure that an exact copy is made. You can then use
resize2fs to expand the new root filesystem to fill its partition, and
tune2fs to change the filesystem label - otherwise you'll have two
filesystems labelled "/", which will confuse the kernel.
More information about the users