Ubuntu: Mounted disk confusion and how to restore order



Question:

Ok so I am not sure what went wrong I have 3 hard disks an 120GB SSD that ubuntu runs on a 500GBHDD and a 480GB SSD both of them having no significant task other than to hold videos and other data.

The think is that after some tinkering a while ago (to fix an other issue) I may have bind a single location like /media/ to BOTH of the 500GB HDD and 480GB SSD.

I noticed that happen because if I tried to copy something from my main 120GB SSD to my 480SSD the file simultaneously got transfered to BOTH hard disks (500GB HDD and 480GB SSD)

After that my quick "fix" was to open disks and unmount the 500GB HDD and set it not to mount ever again.

After that I also noticed that while my intel 480GB sdd was very fast (reaching 480MB/s+ of speed) now just writes at 45 MB....

Tell me what console commands you need me to run for you to make sense of my situation and what to do in order to restore everything to its default.

Thank you.

====================================================================

EDIT after @rtaft 's reply

This is what pops up when I type in sudo fdisk -l | grep sd

Disk /dev/sda: 119,2 GiB, 128035676160 bytes, 250069680 sectors  /dev/sda1       2048   1050623   1048576   512M EFI System  /dev/sda2    1050624 237119487 236068864 112,6G Linux filesystem  /dev/sda3  237119488 250068991  12949504   6,2G Linux swap  Disk /dev/sdb: 447,1 GiB, 480103981056 bytes, 937703088 sectors  /dev/sdb1          6579571 1924427647 1917848077 914,5G 70 DiskSecure Multi-Boot  /dev/sdb2       1953251627 3771827541 1818575915 867,2G 43 unknown  /dev/sdb3        225735265  225735274         10     5K 72 unknown  /dev/sdb4       2642411520 2642463409      51890  25,3M  0 Empty  Disk /dev/sdc: 465,8 GiB, 500107862016 bytes, 976773168 sectors  /dev/sdc1  *     2048 976773119 976771072 465,8G 83 Linux  

SDA as I said is my main disk that runs the ubuntu OS with its partitions (sda1,2,3)

I really dont know what sdb1,2,3,4 are REALLY no idea since I have NOT partitioned anything else! I suppose sdb is my intel 480GB ssd and SDC my WD 500GB HDD

As I said I MAY have used a command (like mkdir) to create a /media/DATA directory and bind by mistake both of the disks to that same folder but I am not sure if its relevant nor can I remember more than that...

Also here is how Disks sees my mounted Intel 480 SSD

enter image description here

And here is how disks sees my WD 500GB HDD (unmounted)

enter image description here

=============================================================================== EDIT No2 in response to @rtaft 's request on what does happen when I try to mount the WD HHD (SDC) enter image description here


Solution:1

My typical mounting scenario is to start with fdisk to identify the disks, in my case what I am looking for is which size matches the /dev/sda or /dev/sdb disks.

$ sudo fdisk -l | grep sd  Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors  Disk /dev/sdb: 5.5 TiB, 6001141572096 bytes, 11720979633 sectors  ....  

Once I know which disk is which, then I look at which ones are mounted. You can look at /etc/mtab but I typically use df which includes where it is mounted and disk space usage

$ df -ah | grep media  /dev/sdb                 5.5T  4.1T  1.5T  75% /media/Disk1  /dev/sda                 1.8T  1.8T   80G  96% /media/Disk2  

For temporarily mounting each drive

$ sudo mkdir /media/Disk1  $ sudo mount /dev/sdb /media/Disk1  $ sudo mkdir /media/Disk2  $ sudo mount /dev/sda /media/Disk2  

For permanent mounting get the UUID from /dev/disk/by-uuid/ that points to the correct /dev/sd*

$ ls -al /dev/disk/by-uuid/  lrwxrwxrwx 1 root root   9 Mar 21 13:36 76d38a67-f1dd-41e9-ab75-8d4ccc760123 -> ../../sda  lrwxrwxrwx 1 root root   9 Mar 21 13:35 23e046d3-2348-4f68-8283-f63366a7f997 -> ../../sdb  

Then add that UUID to your /etc/fstab, you would also need to specify the file system like xfs, ext4, ntfs, vfat, etc.

# /etc/fstab  UUID=23e046d3-2348-4f68-8283-f63366a7f997   /media/Disk1    xfs defaults    0   0  UUID=76d38a67-f1dd-41e9-ab75-8d4ccc760123   /media/Disk2    ext4    defaults    0   0  

Just remember that if you put it in fstab, make sure you remove it from fstab before physically removing the disk, otherwise you may end up being forced to correct it at next bootup.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »