Announcement

Collapse
No announcement yet.

2nd drive as deafult work area. - RESOLVED

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

    2nd drive as deafult work area. - RESOLVED

    Since I know so little about Kubuntu I'll just describe my problem.

    I installed 8.04 on a 40GB hard drive but later added a 640GB drive I'd like to use as my workspace. The second drive is currently mounted as /media. The problem is that I can't just install or download programs into the drive as I can the /home, since it seems to be protected. In Dolphin I can enter my admin pwd and create folders but installs can't happen without my changing the settings somehow.

    The question is can I mount the external drive as /home so its the default place where things are downloaded rather than my crowded first drive or is there some way I can set the permissions so downloads and installations can happen.

    thanks,
    R

    #2
    Re: 2nd drive as deafult work area.

    You can do this easily. You want to mount the new disk temporarily, copy the contents of /home to the new disk. edit /etc/fstab to mount the new disk on /home, and then mount it. At that point it should work as you want and boot that way. I will assume you created an ext3 filesystem on the new disk, partition 1, and it is sdb1.

    With the new disk mounted at /media (not /media/disk?) cd to /home. run

    "sudo cp -a * /media"

    This will copy everything into your new disk with preserved ownership and permissions. Then edit /etc/fstab. If you had a seperate /home partition before just change the first entry to mount the new disk (/dev/sdb1), otherwise add a line like this

    /dev/sdb1 /home ext3 defaults 0 0

    make sure there is a newline at the end of the last line.

    Now , unmount the new disk from /media and mount it at /home with
    "sudo mount /home". You should be all set.


    Comment


      #3
      Re: 2nd drive as deafult work area.

      Seems simple enough but I couldn't make it work.

      I could copy all the files over (It was /media/disk BTW) and I added the line in /etc fstab but I'm getting a "Mountpoint has to be below /media" error.

      fstab currently has this:
      /dev/sda6 for
      /

      /dev/sda1
      /home

      /dev/sda5
      for swap

      thanks

      Originally posted by mando_hacker
      You can do this easily. You want to mount the new disk temporarily, copy the contents of /home to the new disk. edit /etc/fstab to mount the new disk on /home, and then mount it. At that point it should work as you want and boot that way. I will assume you created an ext3 filesystem on the new disk, partition 1, and it is sdb1.

      With the new disk mounted at /media (not /media/disk?) cd to /home. run

      "sudo cp -a * /media"

      This will copy everything into your new disk with preserved ownership and permissions. Then edit /etc/fstab. If you had a seperate /home partition before just change the first entry to mount the new disk (/dev/sdb1), otherwise add a line like this

      /dev/sdb1 /home ext3 defaults 0 0

      make sure there is a newline at the end of the last line.

      Now , unmount the new disk from /media and mount it at /home with
      "sudo mount /home". You should be all set.


      Comment


        #4
        Re: 2nd drive as deafult work area.

        I suspect I was a little unclear in the last part of my instructions. It appears that you have gotten everything copied over to the new partition. Am I right in thinking that /dev/sda1 is your new /home/partition? I would actually rather see a cut and paste of your fstab so I could spot any errors.

        I did not give explicit instructions for how to unmount after the copy. That command would be

        sudo umount /media/disk

        You should then run the mount command in a terminal window, do not try to mount it using dolphin. Open aterminal and run

        sudo mount /home.

        If that does not work please give me very specific information, as /dev/sdb1 is new partition that should become /home, /dev/sda1 is old /home.

        Comment


          #5
          Re: 2nd drive as deafult work area.

          Thanks for the help, I'll try to be more explicit.

          This is what my fstab looks like:
          =========================
          # /etc/fstab: static file system information.
          #
          # <file system> <mount point> <type> <options> <dump> <pass>
          proc /proc proc defaults 0 0
          # /dev/sda6
          UUID=7694ed5c-291f-4df9-9c43-c24b5867d232 / ext3 relatime,errors=remount-ro 0 1
          # /dev/sda1
          UUID=1a6eb4e3-8bf4-4d2d-8e79-c05c8158d2a5 /home ext3 relatime 0 2
          # /dev/sda5
          UUID=c8671572-e3f0-421b-8add-51e36962836e none swap sw 0 0
          /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
          /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
          =========================

          The sda6 seems to be the root and the sda1 is the home which along with the swap are all on the old drive. I don't see the new drive listed at all as the media/disk.

          Would I unmount the sda1 as home and then unmount the media/disk remounting it as home ? After doing these in the Konsole would I then make the changes in fstab ? Can I remount the sda1 as something so I can use it ?

          I know its a simple problem but without having done it need some handholding.

          Thx

          Comment


            #6
            Re: 2nd drive as deafult work area.

            OK. Now we are getting to the meat. The only thing we don't know for sure is the partitioning scheme of you new disk. I assume you created that so you may know what it is, but syou can see it with

            "sudo parted -s /dev/sdb print"

            Then assuming it is /dev/sdb1 and ext3 you do something like this. You need to unmount the new drive with
            sudo umount /media/disk

            Then you want to edit /etc/fstab to look like

            =========================
            # /etc/fstab: static file system information.
            #
            # <file system> <mount point> <type> <options> <dump> <pass>
            proc /proc proc defaults 0 0
            # /dev/sda6
            UUID=7694ed5c-291f-4df9-9c43-c24b5867d232 / ext3 relatime,errors=remount-ro 0 1
            /dev/sdb1 /home ext3 relatime 0 2
            # /dev/sda1
            #UUID=1a6eb4e3-8bf4-4d2d-8e79-c05c8158d2a5 /home/me/oldhome ext3 relatime 0 2
            # /dev/sda5
            UUID=c8671572-e3f0-421b-8add-51e36962836e none swap sw 0 0
            /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
            /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
            =========================

            me in /home/me/oldhome is your username.

            Then you need to unmount /home, which you can not do while logged in as a user with a home on /home, eg you must login as root (skipping an sudo su - trick) so if you have not set a root password yet so this
            sudo -s
            passwd


            Create a good password for root.
            Ctl-Alt-F1 and login as root.

            Alt-F7 to get back to KDE. Make sure you have saved /etc/fstab and logout.
            Ctl-Alt-F1 again

            umount /home

            It should unmount the old home.

            mount /home

            It should now mount the new home

            df -h will show you what is mounted where.

            If your new /home is mounted, Alt-F7 and login to KDE on your new /home.

            Now you can
            mkdir oldhome

            edit /etc/fstab and uncomment the oldhome entry

            sudo mount oldhome

            and your done.

            Comment


              #7
              Re: 2nd drive as deafult work area.

              Ok I edited the fstab as root and saved it.

              But then I run into trouble as I can't unmount /home since I keep getting "umount: /home: device is busy".

              This is probably because I'm still logged in as me and not root. the Ctl-Alt F1 and the Alt-F7 don't do anything and if I log out of Kubuntu using the Kmenu option I'm told I can't log in as root.

              I couldn't force an unmount as some post suggested so I'm guessing its because I'm not root. How can I log in and out as root ?

              thanks
              R

              Comment


                #8
                Re: 2nd drive as deafult work area.

                Have a look here:
                http://ubuntu.wordpress.com/2006/01/...own-partition/
                HP Pavilion dv6 core i7 (Main)
                4 GB Ram
                Kubuntu 18.10

                Comment


                  #9
                  Re: 2nd drive as deafult work area.

                  Using the other method I still have the problem of logging in as root. Using KMenu I am able to switch users and followng another thread I edited the kdmrc file to allow root login but still couldn't login as root.

                  As I also keep reading that I shouldn't allow root login I tried using the System Settings > Advanced >Disk Manager. Here I can unmount and mount it seems but as various processes are currently using home I'm asked if I want to kill them all. If I do I'm afraid the gui will fold.

                  So the questions is can I just mount and unmount /home in the Disk Manager as plain old admin me or do I need to log in as root. If so, besides modifying the kdrmc file is there anything else I need to do to allow root login ?

                  thanks

                  Comment


                    #10
                    Re: 2nd drive as deafult work area.

                    I am surprised that CTL-ALT-F1 does not get you to a Virtual Terminal. That really limits you. Have you tried different combinations of CTL and ALT keys? sometimes one or more of these will be remapped.

                    If you have edited the fstab correctly rebooting should cause it to be mounted as you want. After a reboot youcan use ESC to get a boot menu and chose the rescue item which then allows you to get a root shell.

                    Comment


                      #11
                      Re: 2nd drive as deafult work area. RESOLVED

                      Success, finally. I rebooted rather than just logging off and then it read the revised fstab.

                      Then I used the Disk & Filesystems in Systems Settings to mount the new drive as home and rename the old partition as something else.

                      So the steps seem to be:
                      1. edit the fstab as root which can be done in the GUI from Dolphin using the Action > Edit as Root.
                      2. Reboot the computer and use SYstem Settings to change the file system as needed.

                      Now I got a "No command argument supplied for kdesudo on startup but that's for another thread.

                      Thanks everyone.
                      Love Kubuntu !

                      Comment

                      Working...
                      X