Announcement

Collapse
No announcement yet.

problem with this command "mount /dev/sdb7 /newhome;cd /home;tar cvf - ......"

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

    problem with this command "mount /dev/sdb7 /newhome;cd /home;tar cvf - ......"


    hi pals there.

    I am trying to move my /home from the same partition on which / is installed to new partition.
    I tried on do the job on one go which i copied from pclinuxos homepage, but the command stuck with no response and i died of waiting.
    * also i had problem of understanding what will be the old /home files as there seems no command to tell to delete the old /home files.

    the command is:
    mount /dev/sdb7 /newhome;cd /home;tar cvf - .|(cd /newhome;tar xvf - .);umount /newhome;mount /dev/sdb75 /home

    thanks.

    ese

    #2
    Re: problem with this command "mount /dev/sdb7 /newhome;cd /home;tar cvf - ......"

    Originally posted by ese
    mount /dev/sdb7 /newhome;cd /home;tar cvf - .|(cd /newhome;tar xvf - .);umount /newhome;mount /dev/sdb75 /home
    i don't see anything wrong in this command, except:
    a) it should be run as root, otherwise it won't work
    b) the /newhome directory should be created prior to the execution of this command
    c) the last mount mentions sdb75 instead of sdb7

    this command might take several minutes.
    depends on how many files you're moving (or copying, in your case).

    i'd suggest to run one command at a time, though.
    and check that everything be alright after each step.

    Originally posted by ese
    * also i had problem of understanding what will be the old /home files as there seems no command to tell to delete the old /home files.
    the old files would still be in the / file system in the /home directory.
    mounting sdb7 on the /home mount point will hide what's underneath
    (i.e. the content of the /home directory in the / file system).

    hth
    gnu/linux is not windoze

    Comment


      #3
      Re: problem with this command "mount /dev/sdb7 /newhome;cd /home;tar cvf - ......"


      Thanks jankushka.

      Originally posted by jankushka
      *
      i don't see anything wrong in this command, except:
      a) it should be run as root, otherwise it won't work
      b) the /newhome directory should be created prior to the execution of this command
      c) the last mount mentions sdb75 instead of sdb7
      well you are right, it was a typo error while i was pasting to the forum. The new partition to copy is sdb7. I had already created the newhome folder. of course i run it as root.

      Originally posted by jankushka
      * this command might take several minutes.
      depends on how many files you're moving (or copying, in your case).
      you are right on this too, but i was left with nothing to see on the screen, shall i put the verbose mode, will it work and where shall i write it?

      Originally posted by jankushka
      * the old files would still be in the / file system in the /home directory.
      mounting sdb7 on the /home mount point will hide what's underneath
      (i.e. the content of the /home directory in the / file system).
      This is my main problem. I don't want to waste disk space just by hiding. I wanted to delete the old /home so that i could have more free space in the / partition.
      Is there anyway that i could put a command to delete it.

      thanks again.

      ese

      Comment


        #4
        Re: problem with this command "mount /dev/sdb7 /newhome;cd /home;tar cvf - ......"

        Maybe this will be of use:
        http://ubuntu.wordpress.com/2006/01/...own-partition/
        HP Pavilion dv6 core i7 (Main)
        4 GB Ram
        Kubuntu 18.10

        Comment


          #5
          Re: problem with this command "mount /dev/sdb7 /newhome;cd /home;tar cvf - ......"

          Originally posted by ese
          This is my main problem. I don't want to waste disk space just by hiding. I wanted to delete the old /home so that i could have more free space in the / partition.
          Is there anyway that i could put a command to delete it.
          sure.
          you'd use an rm command on /home/*
          but, as i said, you don't want to do it all in one go.
          if anything goes wrong during the move or copy, then you'd lose all your data.
          better to make sure everything's been copied over.
          then remove.

          Originally posted by Fintan
          well spotted.

          perhaps you want to replace
          Code:
          /dev/hda5 /home ext3 nodev,nosuid 0 2
          with
          Code:
          /dev/hda5 /home ext3 defaults 0 2
          which should really be all you need.

          cheers
          gnu/linux is not windoze

          Comment


            #6
            Re: problem with this command "mount /dev/sdb7 /newhome;cd /home;tar cvf - ......"


            Thanks pals.

            i will give it a try and i shall post the results.


            ese

            Comment

            Working...
            X