How to mount the newly created linux partitions?

It seems repetitive even to myself asking this but I’ve searched this forum and have not been able to fix my issue. I had created one extended partition and installed my UBUNTU 14.04 on it.

Now I have 440 GB available so have recently created two new primary partitions on the free space. But when I click them to mount and access them from the “Places” menu (I have installed Ubuntu-mate) the only thing there I would have is a window opened and I can not create anything on it.

I figured it may have been mounted as root and I have not a single clue how to change it to my username. Could you please help me?

Asked By: Tower

||

This is as I suppose by mounting your partition read only, so either you have to remount with write permissions or add to fstab to automount automatically.

Get the UUID

Run the command:

sudo blkid 

Then open /etc/fstab:

sudo gedit /etc/fstab

Now add the line to the bottom of /etc/fstab:

UUID=UUID /mounting-point ext4 defaults  0      2

Replace UUID with result of your UUID of /dev/sdX

Replace /mounting-point with path to mount the partition on

Replace ext4 with your partition filesystem type

Answered By: Maythux

Ok, This can be the solution:

1- Type the “lsblk” command to see the drives that are seen by your distribution and decide which one you want to mount (in my case it was /dev/sda3) and where you want to set to be its mount point (I chose it to be /mnt/EXTRA_I).

2-use the mount command using sudo like this:
sudo mount -Rc /dev/sda3/ /mnt/EXTRAS_I
(you can learn more about the commands above by typing the command name first, and a --help after it. example:
mount –help`)

3-Now type your password as you’ve been asked to do so.

4-Type lsblk again, and observe that your drive chosen is mounted (one of the fields below “MOUNTPOINT” now contains a strins value. in my case: /mnt/EXTRAS_II).

5-it is time to change the owner from “root” to your own. It was “koorosh” in my case. Example: sudo chown -Rc koorosh:koorosh /mnt/EXTRAS_I

6-Observe the prompts of output that declares the mount point is now yours.

7-Congradulations, You have succeeded, and the next time you want to mount the drive (in my case: EXTRAS_I) and view the contents of it, you will have to just double-click on its name in your file manager.

lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 2.8G 0 part [SWAP]
├─sda2 8:2 0 1K 0 part
├─sda3 8:3 0 210.9G 0 part
├─sda4 8:4 0 219.5G 0 part
├─sda5 8:5 0 7.5G 0 part /
└─sda6 8:6 0 25.1G 0 part /home
sr0 11:0 1 1024M 0 rom


sudo mount /dev/sda3/ /mnt/EXTRAS_I
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 2.8G 0 part [SWAP]
├─sda2 8:2 0 1K 0 part
├─sda3 8:3 0 210.9G 0 part /mnt/EXTRAS_I
├─sda4 8:4 0 219.5G 0 part
├─sda5 8:5 0 7.5G 0 part /
└─sda6 8:6 0 25.1G 0 part /home
sr0 11:0 1 1024M 0 rom


sudo chown -Rc cockroach:cockroach /mnt/EXTRAS_I
changed ownership of /mnt/EXTRAS_II/lost+found’ from root:root to cockroach:cockroach
changed ownership of /mnt/EXTRAS_II’ from root:root to cockroach:cockroach


sudo umount /dev/sda3

Answered By: Tower

To mount a newly created partition in Linux, follow these steps:

  1. Identify the device name of the partition you want to mount. You can do this by using the lsblk command, which will list all the available block devices on your system, including the partitions.

  2. Create a mount point for the partition. This is a directory where the partition will be mounted. You can create a mount point anywhere you like, but it is common to create a directory under /mnt or /media for this purpose. For example, you might create a mount point at /mnt/mypartition.

  3. Use the mount command to mount the partition to the mount point you created. The syntax for this command is:

mount device-name mount-point

For example, if the device name of your partition is /dev/sda1 and you created a mount point at /mnt/mypartition, you would use the following command to mount the partition:

mount /dev/sda1 /mnt/mypartition

  1. If the partition is formatted with a filesystem that is not supported by your Linux distribution, you may need to specify the filesystem type when you mount the partition. You can do this using the -t option followed by the filesystem type. For example:

mount -t ext4 /dev/sda1 /mnt/mypartition

  1. If you want the partition to be automatically mounted every time the system boots, you can add an entry to the /etc/fstab file. This file contains a list of all the filesystems that should be mounted at boot time. To add an entry for your partition, open the /etc/fstab file in a text editor and add a line with the following format:

device-name mount-point filesystem-type options dump pass

For example, if the device name of your partition is /dev/sda1 and you created a mount point at /mnt/mypartition, and the filesystem type is ext4, you could add the following line to /etc/fstab:

/dev/sda1 /mnt/mypartition ext4 defaults 0 0

This will cause the partition to be automatically mounted at boot time using the ext4 filesystem and the default mount options.

Answered By: jacab smith
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.