Announcement

Collapse
No announcement yet.

How do I...replace /home HDD with new one?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I...replace /home HDD with new one?

    I have recently upgraded a works machine and have acquired a spare 40gig HDD.
    My Kubuntu machine has a separate 10gig HDD for the /home directory. I set it up this way so future re installs would not impact on my own documents in the Home folder.
    I want to use the 40 gig drive as the new /home partition.

    How do I go about this? have tried various things over the paste few days, but whenever I swap the HDD's over, the boot process fails, and leaves me at the command line at root@kubuntu

    I BIOS see the drive, fdisk see it and I have re partitioned it as extended partition., but still no boot.

    How is this done?

    #2
    Re: How do I...replace /home HDD with new one?

    http://www-128.ibm.com/developerwork...rtplan.html#h6

    Comment


      #3
      Re: How do I...replace /home HDD with new one?

      Thanks.....

      Will see how I get on.

      Edit:

      NO, no good
      I get to the single user point (No. 4)
      where you type
      init 1 and wait for the root shell, but the machine then takes about 15 minutes to do a complete re boot, and starts again, exactly where it normally does, so cant even get to the copy /home stage

      Comment


        #4
        Re: How do I...replace /home HDD with new one?

        Wondering if it is anything to do with the fact that the new IDE HDD is plugged into a USB adapter and it is not being recognised when it re starts?

        Comment


          #5
          Re: How do I...replace /home HDD with new one?

          You might as well just boot into "recovery mode". It's the same thing, but it's much more likely to work.
          (You might need to fool around with mounting, though.)

          Don't know if you'd want to try it at this point, but the best way to ensure that files are not being used is to boot from a LiveCD and copy the files over from there. (Then it's just clear out the old /home and create an fstab entry.)
          For external use only.

          Comment


            #6
            Re: How do I...replace /home HDD with new one?

            looking in the fstab file now, I see that there is no entry showing where the /home directory is mounted from, so iI assume that as it is a system folder, it is done else where...but is that relevant

            If I boot from a live CD, then copy the one and only partition with the /home directory on that hard drive on to a new partition on a new hard drive, then swap hard drives...will that work?

            Comment


              #7
              Re: How do I...replace /home HDD with new one?

              If your /home is going to be on a separate partition, you'll probably need to mount that partition at boot time. Easiest way to do that is to create an fstab entry.

              On swapping hard drives: if you've got it working now, maybe. It depends on how the drives are assigned nodes (or it could even be done by UUID, which is bad news for you).
              For external use only.

              Comment


                #8
                Re: How do I...replace /home HDD with new one?

                but how is it mounted now? there is no fstab entry for it?

                Comment


                  #9
                  Re: How do I...replace /home HDD with new one?

                  No that did not work.
                  Booted from live cd
                  Mounted old /home as /oldhome
                  mounted the new partition as /newhome

                  in konsole used
                  sudo cp -ax * /newhome

                  after, the properties of both folders showed exactly the same number of files.

                  Shut down, removed the old hdd, and replaced with the new drive.

                  Boot failed at checking file systems:

                  fsck.ext3: unable to resolve 'UUID=......d943.......'
                  fsck died with exit status 8,

                  it then starts a root shell root@Kubuntu

                  Comment


                    #10
                    Re: How do I...replace /home HDD with new one?

                    Yep, it uses UUIDs.

                    Post your fstab (/etc/fstab), then, please.
                    For external use only.

                    Comment


                      #11
                      Re: How do I...replace /home HDD with new one?

                      So is the UUID number something like a MAC address..specific to each piece of hardware? Simply extract the UUID from the new HDD? pop it in the FSTAB and away we go? no I thought not far too simple

                      Anyway here is the fstab

                      # <file system> <mount point> <type> <options> <dump> <pass>
                      proc /proc proc defaults 0 0
                      # /dev/sda1
                      UUID=21b813df-b9b7-4c97-8250-e8861bfbbdac / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
                      # /dev/sdb5
                      UUID=d943ed00-12d7-4c40-b7f5-7ff8c5848f02 /home ext3 nouser,defaults,atime,auto,rw,dev,exec,suid 0 2
                      # /dev/sda5
                      UUID=707dadc4-43e5-48c5-b1fe-8db069ad3987 none swap sw 0 0
                      /dev/scd0 /media/cdrom0 udf,iso9660 user,atime,noauto,rw,dev,exec,suid 0 0
                      /dev/scd1 /media/cdrom1 udf,iso9660 user,atime,noauto,rw,dev,exec,suid 0 0

                      //Su/OGGMusic /home/neil/Music cifs umask=000,uid=1000,gid=1000,auto,rw,user,credentia ls=/etc/fstab_smb_credentials_2 0 0
                      /dev/sdc5 /media auto users,atime,noauto,rw,nodev,noexec,nosuid 0 0

                      Comment


                        #12
                        Re: How do I...replace /home HDD with new one?

                        Done it.

                        Pulled the UUID number off the new drive from in /dev/disk/by-uuid

                        Edited the fstab file, stuck the UUID from the new drive in place of the old drive, physically swapped the drives, and now it boots.

                        Could I have just binned the UUID numbers and replaced it with /dev/sdb5/ or the relevant partition? that might have been easier

                        Cheers for the tips

                        Comment


                          #13
                          Re: How do I...replace /home HDD with new one?

                          Yep, that's exactly what a UUID is.

                          On replacing it with the device node, you could have done that as well. I don't have any UUIDs in my fstab myself, but only because I can't get it to work with UUIDs.
                          For external use only.

                          Comment


                            #14
                            Re: How do I...replace /home HDD with new one?

                            Device node? that must be the collective term for something like /dev/sda2/.
                            Is that correct ?

                            But why use a UUID ? instead of device node.

                            Comment


                              #15
                              Re: How do I...replace /home HDD with new one?

                              To the question directly above: Because device nodes can change, whereas UUIDs are (supposed to be) unique to devices.

                              As a more general response to the topic, here's what I'd do to add the extra 40GB drive. From what you post it seems like you've sorted the problem, but for reference:

                              - Plug the drive in to an IDE socket. Much less hassle than USBing things, and faster transfer of data.
                              - Boot into the live CD, fire up QTPartED and give myself a nice big ext3 partition on the new hard drive, being sure that I'm working on that drive and not the old one.
                              - Close QTPartED, mount both the new and old /home partitions, suck the data across, go and have a cup of tea.
                              - Mount / and edit /etc/fstab to point to the new home partition (I'm an old-timer, I like addressing things as /dev/hda1)
                              - Reboot

                              Then, later on, maybe resize some other partition to soak up the 10GB excess space.

                              Comment

                              Working...
                              X