Results 1 to 10 of 17

Thread: How do I change a partition mount point from /tmp ?

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Beans
    4

    How do I change a partition mount point from /tmp ?

    Hi I'm a new ubuntu user and I installed Ubuntu 8.10 as a dual boot with WinXP. I partitioned my 500 GB hard drive into a few partitions. I gave 45 GB to / and 150 GB to /home (which I'm happy about) and mounted a 100GB partition to /tmp without really understanding what /tmp was for. That was kind of dumb.

    Now I would like to change /tmp to be on the same partition as /. (As if I had never given it a separate partition in the first place.) So I will just have one partition for /, one for swap, and one for /home.

    I've already tried messing with /etc/fstab, and I've tried using gparted to unmount that 100 GB partition but I don't really know what I'm doing. Changing fstab made my computer unable to start up. (I recovered by booting from a Live CD), and gparted said it couldn't unmount the 100 GB partition.

    part of my problem might be I'm not really clear about how the folders work in ubuntu. Do I mount a drive onto a folder or a folder onto a drive? Why don't partitions have letters like in windows (C: E: ...)?

  2. #2
    Join Date
    Jul 2007
    Beans
    419
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How do I change a partition mount point from /tmp ?

    I’ll take a shot at this, in reverse order, kind of. Linux doesn’t use drive letters, like in Windows, because Linux isn’t Windows. Sorry, I know that sounds like a smart a** answer, but it’s not meant to be, it’s simply the answer. As you pointed out, Windows uses C: D: E:, etc, and it is purely Windows jargon. The way GNU/Linux recognizes hard drives and partition actually makes much more sense, at least to me. Hard drives will be seen in two different ways:
    hdx (where x will be some letter) or
    sdx

    hda= ATA/IDE hard drives
    sda=SATA hard drive

    Some linux distros still use hda. A few versions back, Ubuntu (or probably Debian) decided the SATA drivers worked better, so both kinds of drives are seen as SATA hard drives.

    sda is the first hard drive
    sdb is the second, etc
    sda1 is the first hard drive, first partition
    sda2 is the first hard drive, second partition
    sdb1 is the second hard drive, first partition
    sdb2 is the second hard drive, second partition

    OK, now your other problems……What exactly did you do when you altered fstab? This is just a guess, but I have a feeling you were trying to mount 100G partition at the same mount point as /
    Here’s two other observations:
    Making a separate /home partition was a great idea and may help immensely in this case if you end up having to repartition and re-install. Also, I have always had better luck with the GParted Live CD, as opposed to using GParted off the Ubuntu Live CD

  3. #3
    Join Date
    Jul 2007
    Beans
    419
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How do I change a partition mount point from /tmp ?

    Depending on how and where your partitions are laid out, your solution may be very simple…..backup the data on the 100G partition, delete that partition, re-size the root partition, then make the corrections to fstab. Can you post your fstab file, and a screenshot of what GParted shows?

  4. #4
    Join Date
    Aug 2009
    Beans
    4

    Re: How do I change a partition mount point from /tmp ?

    Hi RBC,

    Thanks for the reply! I attached a screen shot of gparted and below is the text from my fstab file. (the line wrapping might not work quite right.)

    When I wrote my original post I was on another computer and working from memory so I got some of my partition sizes wrong. I hope it's all clear from the image what is what.

    When I tried messing around with fstab, all I did was comment (#) the line referring to the tmp folder. I had hoped that if it didn't mount the sda6 partition into /tmp the os would boot up and the temp folder would just exist on the / partition (sda2) and sda6 would be free and unmounted.

    Since sda6 was just the tmp folder, do I really need to back up the files? as far as I can tell I don't need anthing that's in there. It's just a temp folder and ubuntu is bound to delete all those files anyway, right? Also, do I need to resize sda2? I think the 42GB for / is enough.

    If I can get this to work, my plan is to reformat the sda6 partition as another NTFS drive for windows.

    # /etc/fstab: static file system information.
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    # /dev/sda2
    UUID=db47a127-de48-4c93-be16-2f3e17df4a25 / ext3 relatime,errors=remount-ro 0 1
    # /dev/sda5
    UUID=488e312f-dd1e-40fb-b90b-24265e70c98f /home ext3 relatime 0 2
    # /dev/sda6
    UUID=de7a43f2-41b6-42ad-a6c0-e759096b3075 /tmp ext3 relatime 0 2
    # /dev/sda7
    UUID=af56cc8b-a392-4589-bbc2-3a1054187a02 none swap sw 0 0
    /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

    Thanks again!
    Attached Images Attached Images

  5. #5
    Join Date
    Jul 2007
    Beans
    419
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How do I change a partition mount point from /tmp ?

    OK. I was confused about what you wanted to accomplish. I thought you wanted to merge sda6 with sda2, so no, you do not need to resize sda2. To be honest, I have no idea why commenting out that line would be the system unbootable, unless the install process put something on that sda6 partition that is necessary to boot, although this seems unlikely to me. What data is there? And have you tried, either via fstab or manually, mounting that partition somewhere more normal, /mnt/datapartition perhaps? Another thing I just noticed, unless my tired eyes are deceiving me, GParted shows sda5 as swap, and sda7 as /home. These seemed to be reversed in fstab. Am I seeing that wrong?

  6. #6
    Join Date
    Feb 2008
    Location
    Land of fire and drought
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How do I change a partition mount point from /tmp ?

    Just delete /tmp in Gparted then create a new partition in the free space called /whatever_you_like

    Change your /etc/fstab to reflect that change. There should be an entry for /tmp partition in there and just change /tmp to whatever you called your newly created partition. You may need to check you have the right UUID in there. You can do that with:

    Code:
    sudo blkid
    ... in a terminal.

    Delete the mount point /tmp from /media/tmp and replace with one for the new partition and you should be good to go.

    Code:
    sudo mkdir /media/whatever_you_called_it
    Last edited by Bucky Ball; September 1st, 2009 at 04:43 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •