Re: Moving /home to a LVM



On 20/12/2007, Sorin Srbu <sorin.srbu@xxxxxxxxxxxxx> wrote:
Sorin Srbu <> scribbled on Wednesday, December 19, 2007 10:44 PM:

Basic steps (taken from our dept's support-kb). All steps done as root:

1. Inform user of plans to add new harddrive and tell them to backup anything
important off of the particular computer should anything go seriously
pearshaped.

2. Shutdown computer.

3. Install new hd.

4. Boot computer.

5. Set computer to runlevel 1 (single-user login), so that no users may log on
while finishing the move.

6. Check /etc/sysconfig/hwconfig to find out what the hd is actually called.
Should normally be "hdb".

7. Run "fdisk /dev/hdb" to prepare the new disk.

8. Press p to see a partition list.

9. Press n to create a new partition hdb1. Use primary, 1, 1 and the default
settings.

10. Press w to write the partition data and stuff to disk.

11. Run "mkfs.ext3 /dev/hdb1" to format the partition.

12. Move the old /home to eg /home.bak, "mv /home /home.bak".

13. Create new /home, "mkdir /home".

14. Mount the new new hd to /home, "mount /dev/hdb1 /home".

15. Copy the data from /home.bak to /home, "cp -vrf /home.bak /home".

16. Edit /etc/fstab to automount /dev/hdb1 as /home at boot. Copy the deault
settings; compare with other mounts in fstab.

17. Reboot.

18. Ensure the computer is running at runlevel 5 (multiuser with X).

[19. Optional: Leave /home.bak in place until you see all is working as it
should, after this you can delete it as appropriate.]


HTH.



Joey Prestia <> scribbled on Wednesday, December 19, 2007 9:17 PM:

I did this just the other day, although not using LVMs, just ragular
old-school partitioning - I find those confusing and difficult to tweak
later.

I'll mail the steps I did in the morning thursday; am home now and don't
my notes here. It's not that difficult, unless you start from LVMs on
your old drive...


I am out of room on my /home partition which is just ext3 and I am
wanting to move it to a unpartitioned area which i plan on making a LVM
and once the data is moved I want to make the old /home partition LVM
also and join it to the new LVM that I am creating. What I am unsure of
is how to move the data do I just tar it up and move it to the LVM and
untar it add the new part to fstab and take the old part out? will I
have to reboot? any Help greatly appreciated.

Thanks Joey

I'd copy using "cp -pr /home.bak /home". The -p option preserves
mode, ownership and permissions.

Kind regards,

Herta

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



Relevant Pages

  • When LVM Goes Bad
    ... I believe LVM is the default on Fedora partitioning now, at least I didn't love it that much that I would have selected it, and it is on all my boxes now. ... However LVM makes less sense on, say, a laptop which has and will only ever have a single 2.5" HDD for storage that is permanently available with the laptop. ... The resulting symptom was that the partition contents were no longer recognized as containing a logical volume or a volume group, nor pvscan, although pvdisplay could see it was a physical volume if pointed directly at the partition. ... Whether this explained the loss of LVMness or a subsequent logical brain damage that happened elsewhere did it I don't know. ...
    (Fedora)
  • Re: Hosed Grub with the push of a button
    ... occupies part of the LVM. ... I don't think the developers of the program counted on some crazy button changing the partition table with one touch. ... Did it write over that portion of the disk or did it actually format the portion and place information from some storage chip on the mother board. ... My guess would be that the motherboard has a chip inside that has a compressed image of what was originally installed on the computer, like what a install CD would have. ...
    (Fedora)
  • Re: What are the advantages of LVM?
    ... If you want to learn more about LVM these two web sites can get you ... PartitionMagic or whatever) to split the disk up into partitions. ... or from another partition and run cfdisk or fdisk to set the ... Unfortunately, once I did partition the hard disk, I forgot to mark / as ...
    (Ubuntu)
  • RE: lvm on RH8 _ SOLVED_
    ... Apparently, the lvm module wasn't getting initialised at boot, so I ... Using fdisk, change the partition usage to 0x8e (free space, logical ... Next the filesystem needs to be created in the logical volumes. ...
    (RedHat)
  • Re: what to do with a new harddisk
    ... >>If you have done a default install of FC3 then you will be using LVM. ... >>partition and mounting it at a fixed mountpoint, ... > The new table will be used at the next reboot. ... The partition type is 8e (Linux LVM), ...
    (Fedora)