0

If you refer to my other posts, I am trying to use g++ and in order to compile a .cpp file I'll have to refer to it with the drive name:

g++ /media/drivename/filename.cpp

The problem is with the file path, as you see the drives are named so ridiculously with some random number group. I can't just type in

g++ /media/123414 14124 14 1/filename.cpp

I tried relabelling the partitions and turns out you don't refer to them with their labels but with their names and these names are based on where the drives are MOUNTED. As you can see in the below picture, these are mounted at this ridiculous location /whateverucallit. This is frustrating. I just switched to Ubuntu, and I'm having a really hard time here.

Example

The partitions were created after the ubuntu was installed and they were created with GParted. I have looked at other threads telling you to edit your etc/fstab there is no fstab folder there except a fstab.d folder and that too: an empty one.

Okay, my bad. It was talking about the fstab file. There is one here are the contents of the file:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=956d7e6e-6935-4de9-80ec-4e4f80a510db /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=b6dea36c-6e78-46c4-a566-9a850ddd2c9c none            swap    sw              0       0

Turns out fstab doesn't even mention the two newly created partitions. What now?.

UPDATE:

I added the following lines in fstab but since they did nothing, I've commented them out.

#device        mountpoint             fstype    options  dump   fsck

#/dev/sda3    /home/robbino/driv1    ext3    defaults    0    1
#/dev/sda4    /home/robbino/driv2    ext3    defaults    0    1

Here's the sudo fdisk-l output

$ sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001ec87

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   206092287   103045120   83  Linux
/dev/sda2       617037822   625141759     4051969    5  Extended
/dev/sda3       206092288   415674367   104791040   83  Linux
/dev/sda4       415674368   617035775   100680704   83  Linux
/dev/sda5       617037824   625141759     4051968   82  Linux swap / Solaris

Partition table entries are not in disk order
4
  • possible duplicate of How to mount a new drive on startup
    – JoKeR
    Mar 1, 2015 at 13:14
  • Not really, it's not about mounting it up on startup as mine are always mounted on startup. Just the mount location that needs to be modified. I could just change in fstab if it was mentioned in it Mar 1, 2015 at 13:19
  • 1
    It's because it isn't mounted in fstab that Ubuntu is mounting it in /media.
    – Carl H
    Mar 1, 2015 at 13:22
  • Will the following lines do? #device mountpoint fstype options dump fsck /dev/sda3 /home/robbino/drivex ext3 defaults 0 1 /dev/sda4 /home/robbino/drivey ext3 defaults 0 1 Mar 1, 2015 at 13:28

1 Answer 1

1

Open a terminal and type:

sudo blkid

Find and copy needed uuid to reproduce it in fstab then run:

sudo -H gedit /etc/fstab

add to the end lines like this (e.g.):

#My-Partition
UUID=xxxxxxxxxxxxxxx /media/Robbino1              ext3
defaults 0 1

Where xxxxxxxxxx is /dev/sda uuid that you copied, then reboot.

You can also manually change permissions (e.g.):

rw,auto,user,nls=utf8,umask=003,gid=1000,uid=1000 0 0

More detailed on mounting options here.

5
  • Tried exactly what you told and on restart it said "Serious errors detected while looking for /media/robbino1" press i to skip mounting" Now, the devices aren't mounted at all. I'll go comment out those lines Mar 1, 2015 at 14:33
  • The following lines are the ones I'm commenting out at this instant. UUID=ae5bdc4c-586f-42de-b43c-94f7deedcb02 /media/Robbino1 ext3 defaults 0 1 UUID=ae5bdc4c-586f-42de-b43c-94f7deedcb02 /media/Robbino2 ext3 defaults 0 1 Mar 1, 2015 at 14:36
  • It worked. But now on restart it says "error mounting /etc/fstab/." Mar 1, 2015 at 14:45
  • It worked! Thank you!! There was this 'w' character in the beginning of file that must've been a typo. I deleted it and restarted. Worked like a charm. THANK YOU,DUDE! THANKS A LOT! brotherly hugs keeping crotch 42 km away Mar 1, 2015 at 14:55
  • You're welcome! Glad it worked for you.
    – JoKeR
    Mar 1, 2015 at 14:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .