LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mounting hard drive issue (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-hard-drive-issue-4175651948/)

hkjz 04-11-2019 08:41 AM

mounting hard drive issue
 
Dear All,

I have clean old hard drive at /dev/sdb,
instead of mounting it through GUI, i wanted to mount it through bash,
and something simple failed - let me explain.

Now situation looks like:

Code:

Failed to mount "My Drive"
No object for D-Bus interface.

That is in GUI, if i want to mount the drive.


how did i got there?
I wanted to try powers and mount it through bash,

first ive created a folder in /media

Code:


sudo mkdir disk

Then ive tried to mount the drive through

Code:


  539  sudo mount -t NTFS /dev/sdb /media/mq/disk

i've got the message

Code:


mount: unknown filesystem type 'NTFS'

So obviously i didnt know, what should be proper TYPE.

So ive tried different types (DOS, no type)

other commands that ive used (from history)
Code:

526  cd /dev/sdb1
  527  mount | grep sda
  528  mount | grep sdb
  529  mount /dev/sdb
  530  mount /dev/sdb1
  531  mount /dev/sdb1 NTFS /dev/sdb1 /media/disk
  532  mount -t NTFS /dev/sdb1 /media/disk
  533  sudo mount -t NTFS /dev/sdb1 /media/disk
  534  sudo mount -t NTFS /dev/sdb1 /media/mq/disk
  535  fdisk
  536  history
  537  fdisk -l
  538  sudo fdisk -l
  540  sudo mount -t dos /dev/sdb /media/mq/disk
  541  sudo mount -t  /dev/sdb /media/mq/disk
  542  sudo mount -t vfat /dev/sdb /media/mq/disk
  543  sudo mount -t ntfs /dev/sdb /media/mq/disk
  544  history

so as you see nothing really bad (i suppose) went to my bash
but somehow connection is broken,

which is great on the other hand,
because there is a space to dig.

On the other, i cannot proceed with things i wanted to do AFTER mounting
Thank you for help.

michaelk 04-11-2019 08:45 AM

Quote:

I have clean old hard drive at /dev/sdb,
Define clean. It it a USB or internal hard drive? Is it partitioned and formatted with a filesystem?

Post the output of the command lsblk

BW-userx 04-11-2019 09:00 AM

/dev/sdb it needs to be /dev/sdbx the partition number you want to mount, not the device itself.
x= partition number.

Code:

mount /dev/sdb1 NTFS /dev/sdb1 /media/disk
should be
mount -t ntfs  /dev/sdb1 /media/disk
or
mount -t auto /dev/sdb1 /media/disk
or
mount /dev/sdb1 /media/disk


hkjz 04-11-2019 09:02 AM

OK,

How can we 100% be positive about disks TYPE? (check 'man mount' > mount -t type device dir)


This is Western Digital HDD SATA 2.5,
it is empty
i've recovered data with photorec,
than I've made partition with

Code:

sudo fdisk /dev/sdb
as a type I've chosen Hex code 86 or 87 - both are descripted as 'NTFS volume set'

Code:

$ lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  1.8T  0 disk
├─sda1  8:1    0  100M  0 part
sdb      8:16  0 298.1G  0 disk
└─sdb1  8:17  0 298.1G  0 part


Quote:

BW-userx
thats true, it seems it get stopped more on the TYPE than '1' from /dev/sdb1

BW-userx 04-11-2019 09:16 AM

Quote:

Originally Posted by hkjz (Post 5983699)
OK,

How can we 100% be positive about disks TYPE? (check 'man mount' > mount -t type device dir)


This is Western Digital HDD SATA 2.5,
it is empty
i've recovered data with photorec,
than I've made partition with

Code:

sudo fdisk /dev/sdb
as a type I've chosen Hex code 86 or 87 - both are descripted as 'NTFS volume set'

Code:

$ lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  1.8T  0 disk
├─sda1  8:1    0  100M  0 part
sdb      8:16  0 298.1G  0 disk
└─sdb1  8:17  0 298.1G  0 part




thats true, it seems it get stopped more on the TYPE than '1' from /dev/sdb1

take a closer look at the command you used. From your first post, these are all different
Code:

  531  mount /dev/sdb1 NTFS /dev/sdb1 /media/disk
  532  mount -t NTFS /dev/sdb1 /media/disk
  533  sudo mount -t NTFS /dev/sdb1 /media/disk
  534  sudo mount -t NTFS /dev/sdb1 /media/mq/disk

Code:

to get the actual path to the mount point (dir) you want to mount to. You have two different paths and the wrong format for your command.
ls /media
say it is
/media/mq/disk
then letting the system figure out what format it is.
mount /dev/sda1 /media/mq/disk
or telling it. lower case
mount -t ntfs /dev/sda1 /media/mq/disk

pay attention to detail.

hkjz 04-11-2019 09:16 AM

OK BW-userx,
details are important, history showing trail and error path

it was
Code:

sudo mount -t ntfs  /dev/sdb1 /media/mq/disk
it works now, thank you

for future, let me repeat one question
How can we 100% be positive about disks TYPE? (check 'man mount' > mount -t type device dir)

thank you

BW-userx 04-11-2019 09:24 AM

I just let the system figure it out whenever I mount.
try removing the -t ntfs from your mount command.
Code:

sudo mount /dev/sdb1 /media/mq/disk
It should still mount it properly. It does on mine.

7 Ways to Determine the File System Type in Linux

Quote:

$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/root ext4 39G 15G 22G 41% /
devtmpfs devtmpfs 3.6G 0 3.6G 0% /dev
tmpfs tmpfs 32M 1.5M 31M 5% /run
tmpfs tmpfs 3.6G 49M 3.6G 2% /dev/shm
cgroup_root tmpfs 8.0M 0 8.0M 0% /sys/fs/cgroup
/dev/sdb6 ext4 87G 1.9G 81G 3% /home
/dev/sda2 fuseblk 202G 189G 13G 94% /media/ntfs1
/dev/sda1 ext4 260G 168G 79G 68% /media/data1
tmpfs tmpfs 3.6G 142M 3.5G 4% /tmp
/dev/sdc1 ext4 917G 699G 172G 81% /run/media/userx/1TB
/dev/mmcblk0p1 ext4 6.4G 202M 5.9G 4% /run/media/userx/sdCard
/dev/sdd1 ext4 1.8T 1.2T 552G 69% /run/media/userx/2TBInternal
/dev/sde1 ext4 3.6T 3.4T 16G 100% /run/media/userx/4TB_esaystore
fast and easy. You could pipe it to awk too, just to get the parts you need.

hkjz 04-11-2019 09:51 AM

Ok,

Code:

df -Th
is good, but show just mounted devices,

it seems like
Code:

lsblk -f
showing just all info which are necessary for proper mounting HDD,

your link is great,

hkjz 04-11-2019 12:34 PM

my i somehow delete my message?
I wanted to post new topic,
sorry for inconvenience

fatmac 04-12-2019 04:42 AM

To see how a drive is formatted, you can use
Code:

fdisk -l /dev/sd?


All times are GMT -5. The time now is 02:29 PM.