Author Topic: Linux noob: having a hard time mounting drives  (Read 539 times)

0 Members and 1 Guest are viewing this topic.

Offline PsychoRebellious

  • Peasant
  • *
  • Posts: 130
  • Cookies: -6
    • View Profile
    • My Rantings
Linux noob: having a hard time mounting drives
« on: March 01, 2015, 02:44:35 pm »
, 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.
(image 1)

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
Code: [Select]
# /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
Code: [Select]
#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
Code: [Select]
robbino@robbino-Latitude-E6410:/$ 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

Offline PsychoRebellious

  • Peasant
  • *
  • Posts: 130
  • Cookies: -6
    • View Profile
    • My Rantings
Re: Linux noob: having a hard time mounting drives
« Reply #1 on: March 01, 2015, 03:59:47 pm »
Not sure why you cant do it, but I am able to rename them and then refer to them by name. For instance most of my shit is in /root/media/Storage which is a separate partition.

Another mistake you might be making is the fact that you are not calling upon the drive correctly if you are using a user account. It would be: /media/username/drivename/file  not:  /media/drivename/file

Because my partitions were created after the installation so the fstab didn't recognize them and they were not mounted in /media/
Anyway, finally it's working. Found the solution by appending the fstab with the following lines
Code: [Select]
UUID=ae5bdc4c-586f-42de-b43c-94f7deedcb02 /media/Robbino1 ext4 defaults 0 1

UUID=b7aaa7c8-63fa-4556-b028-c2242fdc3d59 /media/Robbino2 ext4 defaults 0 1
the UUID of the unmounted partitions was found by
Code: [Select]
sudo blkid