LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-17-2016, 03:56 PM   #1
MarianH
LQ Newbie
 
Registered: Sep 2016
Posts: 22

Rep: Reputation: Disabled
Trying to mount a usb disk to a folder


Dear all,

I would like to ask you for help how to mount an external USB drive to a folder properly. I am a complete Linux noob, so everything written below is from various discussions I've found on the internet.
I have an external usb disk where I have data (hope they are still there). If I try to mount it to a folder it says mount: wrong fs type, bad option, bad superblock on /dev/sdb1, ...doing e2fsck it says superblock cannot be read or does not describe a valid ....so I did e2fsck -b 32768 and still the same error.

I am already desperate ... I really would like to save the data (or at least as big part as possible) on that drive, however I have no idea what should I do.

I've read I should do a backup of the drive before doing any "experiments", however after doing some googling I think (still not 100% sure) the "new disk" has to be bigger than the "original" 2TB HDD. Unfortunately I don't have bigger one and currently have no possibility to borrow one, therefore I have to risk that by trying to make it work, I'll loose the data.

Any suggestions please?

Thank you.
 
Old 09-19-2016, 09:26 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
What is the (exact) command you are using when you try to mount the device?
 
Old 09-19-2016, 09:35 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,736

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
In addition,
What linux distribution/version are you running? Typically most external drives are formatted as NTFS by the manufacture so running linux utilities is not recommended.

Most mainstream distributions install ntfs-3g by default and depending on the desktop will automatically mount external drives.

Does this drive still work with windows?
 
Old 09-19-2016, 11:43 AM   #4
MarianH
LQ Newbie
 
Registered: Sep 2016
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
In addition,
What linux distribution/version are you running? Typically most external drives are formatted as NTFS by the manufacture so running linux utilities is not recommended.

Most mainstream distributions install ntfs-3g by default and depending on the desktop will automatically mount external drives.

Does this drive still work with windows?
Hello,

well, to explain you the situation a bit more. I've had this USB disk connected to Ubuntu - Zentyal. This was mounted automatically by the system start.
Then the USB HDD was disconnected (the thing is I am not sure if properly) and now it is connected to CentOS6 - Nethserver. I was trying to mount it to Nethserver. As this was not working, I've returned back Ubuntu (I have two HDDs which I can take out of the machine and one holds Ubuntu and second Nethserver, so I can change these anytime), however it was working neither.
The USB HDD was always connected to Linux, never to Win.
And now the command. I have a folder in root called Share. So I did
mount -t vfat /dev/sdb1 /share/
 
Old 09-19-2016, 04:27 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,996

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Hello and welcome to LQ.

Stop what you doing first of all. Let us sort this out.
Making changes may not make it easier.


I think you did something along these lines?
https://linuxexpresso.wordpress.com/...ock-in-ubuntu/
 
Old 09-19-2016, 04:43 PM   #6
MarianH
LQ Newbie
 
Registered: Sep 2016
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
Hello and welcome to LQ.

Stop what you doing first of all. Let us sort this out.
Making changes may not make it easier.


I think you did something along these lines?
https://linuxexpresso.wordpress.com/...ock-in-ubuntu/
Hello,

yes, that's exactly what I did as you can see in my first post. And it didn't work unfortunately :-(
 
Old 09-19-2016, 05:11 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,736

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
How is the formated?
Do you normally use in windows?
 
Old 09-19-2016, 05:13 PM   #8
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,141
Blog Entries: 6

Rep: Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828Reputation: 1828
lsblk for dev node, then check what file system it has on it.
Code:
# fdisk -l /dev/sdb
Disk /dev/sdb: 986 MiB, 1033895936 bytes, 2019328 sectors
........

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1          64 2019327 2019264  986M  6 FAT16
or
Code:
# parted -l /dev/sdb
.........
Number  Start   End     Size    Type     File system  Flags
 1      32.8kB  1034MB  1034MB  primary  fat16
then:
Code:
# mount -t vfat /dev/sdb1 ~/usb
or if ntfs
Code:
# parted -l
.........
Number  Start  End     Size    File system  Flags
 1      0.00B  15.5GB  15.5GB  ntfs
then
Code:
# ntfs-3g /dev/sdb1 ~/usb
Also ntfsfix and friends came with ntfsprogs, now the come with ntfs-3g

I've used it before on ntfs volumes and it worked ok to repair it.
 
Old 09-19-2016, 07:25 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
mounting a USB HDD is a bit silly, to me, not that it cannot be done. when all one has to do is plug in it ,then open a filemanager then click on that drive as it should be getting auto mounted, the clicking onto that drive within the filemanager is to finalize the connection to the drive.

if one is to mount it during boot up in fstab (correct me if I am wrong) but if it is not present during booting you're going to get a boot error leaving not being able to fully boot into your system, until you correct the problem.


Code:
sudo blkid (to get the mount point]
sudo mount /dev/sdx /mnt
done

for fk disk if it is a windows format did you try using windows to scan and repair it?

Last edited by BW-userx; 09-19-2016 at 07:45 PM.
 
Old 09-20-2016, 12:06 PM   #10
MarianH
LQ Newbie
 
Registered: Sep 2016
Posts: 22

Original Poster
Rep: Reputation: Disabled
Hello,

thank you for all your posts. This is what I get.

fdisk -l /dev/sdb

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 2000.4 GB, 2000398933504 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002edd1

Device Boot Start End Blocks Id System
/dev/sdb1 1 243202 1953514583 ee GPT



sudo blkid
/dev/sda1: UUID="2112ba5b-ab3c-4f83-986d-82dc8fde5de9" TYPE="ext3"
/dev/sda2: UUID="1v3xAT-zsVn-kEim-3wfT-7aEC-NwxY-1nR0Ut" TYPE="LVM2_member"
/dev/mapper/VolGroup-lv_swap: UUID="09acb377-c813-46ae-acaf-c388e044a963" TYPE="swap"
/dev/mapper/VolGroup-lv_root: UUID="098274fc-3eee-4000-b80c-f4327b288fb4" TYPE="ext4"


sudo mount /dev/sdb1 /mnt
mount: you must specify the filesystem type


Does that mean he doesn't see the sdb1?
 
Old 09-20-2016, 07:56 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
check the filesystem type using the file command:
Code:
sudo file -sL /dev/sdx

 mount /dev/sdx /destination -t fileSystemType
as far as this
Quote:
sudo blkid
/dev/sda1: UUID="2112ba5b-ab3c-4f83-986d-82dc8fde5de9" TYPE="ext3"
/dev/sda2: UUID="1v3xAT-zsVn-kEim-3wfT-7aEC-NwxY-1nR0Ut" TYPE="LVM2_member"
/dev/mapper/VolGroup-lv_swap: UUID="09acb377-c813-46ae-acaf-c388e044a963" TYPE="swap"
/dev/mapper/VolGroup-lv_root: UUID="098274fc-3eee-4000-b80c-f4327b288fb4" TYPE="ext4"

---
sudo mount /dev/sdb1 /mnt
mount: you must specify the filesystem type


Does that mean he doesn't see the sdb1?
it is not showing up in bkid, so you just ball parked it ??

Last edited by BW-userx; 09-20-2016 at 08:58 PM.
 
Old 09-21-2016, 12:53 AM   #12
MarianH
LQ Newbie
 
Registered: Sep 2016
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
check the filesystem type using the file command:
Code:
sudo file -sL /dev/sdx

 mount /dev/sdx /destination -t fileSystemType
it is not showing up in bkid, so you just ball parked it ??
It shows this:
[root@server ~]# sudo file -sL /dev/sdb
/dev/sdb: x86 boot sector; partition 1: ID=0xee, starthead 0, startsector 1, 3907029166 sectors, code offset 0xb8

[root@server ~]# sudo file -sL /dev/sdb1
/dev/sdb1: x86 boot sector, code offset 0x52, OEM-ID "NTFS ", sectors/cluster 128, reserved sectors 0, Media descriptor 0xf8, heads 255, hidden sectors 63, dos < 4.0 BootSector (0x80)


Sorry, I don't understand your comment below. Could you please write it as for dummies :-D (I am linux noob)

Quote:
Originally Posted by BW-userx View Post
it is not showing up in bkid, so you just ball parked it ??
 
Old 09-21-2016, 07:53 AM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by MarianH View Post
It shows this:
[root@server ~]# sudo file -sL /dev/sdb
/dev/sdb: x86 boot sector; partition 1: ID=0xee, starthead 0, startsector 1, 3907029166 sectors, code offset 0xb8

[root@server ~]# sudo file -sL /dev/sdb1
/dev/sdb1: x86 boot sector, code offset 0x52, OEM-ID "NTFS ", sectors/cluster 128, reserved sectors 0, Media descriptor 0xf8, heads 255, hidden sectors 63, dos < 4.0 BootSector (0x80)


Sorry, I don't understand your comment below. Could you please write it as for dummies :-D (I am linux noob)
when you do sudo blkid it will show everything (hdd) connected to your system. I didn't see /dev/sdb1 in that listings you posted. So I inquired how you came about using /dev/sdb1.

ie.
Code:
userx@voided & ~ >> $sudo blkid
/dev/sda1: LABEL="System Reserved" UUID="16BE1703BE16DAD7" TYPE="ntfs" PARTUUID="0004ed67-01"
/dev/sda2: UUID="6602CF6F02CF42B3" TYPE="ntfs" PARTUUID="0004ed67-02"
/dev/sda3: UUID="ee8bca61-3837-47e3-8601-77e0ba20f446" TYPE="ext4" PARTUUID="0004ed67-03"
/dev/sda4: UUID="2cbaed98-039f-45d4-bf0d-4eb200009ec4" TYPE="ext4" PARTUUID="0004ed67-04"
/dev/sdb1: UUID="db09f385-7bce-4640-9159-84d9fd89ff06" TYPE="ext4" PARTUUID="0f3f3740-01"
/dev/sdb2: LABEL="ssd2" UUID="0f18d5ee-14a6-4f0b-9d88-37b3140ed748" TYPE="ext4" PARTUUID="0f3f3740-02"
/dev/sdc1: LABEL="WD3TB" UUID="89f35fb4-9578-42ca-9244-0f4b5ef1604d" TYPE="ext4"
/dev/sdd1: LABEL="wd1tb" UUID="76D2-05BB" TYPE="vfat" PARTUUID="4d6d966b-01"
/dev/sde1: UUID="a06fed17-47a5-4ae9-85a1-416e4a4124a7" TYPE="ext4" PARTUUID="41c874ec-01"
your /dev/sdb1 is telling you it is NTFS. so you'll have to be sure that ntfs-3g is installed then use the -t ntfs-3g switch/argument when mounting it.

the difference between /dev/sdb and /dev/sdb1 . /dev/sdb is the entire device whereas /dev/sdb1 is a partition on said device. when using the dd program. This is one that you use the device name with. Most other operations like mounting and searching device you use the partition, and path to directory if wanted. I hope that helped give you a litte more insight.

Insight 2: when logged in as root you do not have to use the sudo command, that is being redundant

Last edited by BW-userx; 09-21-2016 at 08:08 AM.
 
Old 09-21-2016, 08:29 AM   #14
MarianH
LQ Newbie
 
Registered: Sep 2016
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post


when you do sudo blkid it will show everything (hdd) connected to your system. I didn't see /dev/sdb1 in that listings you posted. So I inquired how you came about using /dev/sdb1.

ie.
Code:
userx@voided & ~ >> $sudo blkid
/dev/sda1: LABEL="System Reserved" UUID="16BE1703BE16DAD7" TYPE="ntfs" PARTUUID="0004ed67-01"
/dev/sda2: UUID="6602CF6F02CF42B3" TYPE="ntfs" PARTUUID="0004ed67-02"
/dev/sda3: UUID="ee8bca61-3837-47e3-8601-77e0ba20f446" TYPE="ext4" PARTUUID="0004ed67-03"
/dev/sda4: UUID="2cbaed98-039f-45d4-bf0d-4eb200009ec4" TYPE="ext4" PARTUUID="0004ed67-04"
/dev/sdb1: UUID="db09f385-7bce-4640-9159-84d9fd89ff06" TYPE="ext4" PARTUUID="0f3f3740-01"
/dev/sdb2: LABEL="ssd2" UUID="0f18d5ee-14a6-4f0b-9d88-37b3140ed748" TYPE="ext4" PARTUUID="0f3f3740-02"
/dev/sdc1: LABEL="WD3TB" UUID="89f35fb4-9578-42ca-9244-0f4b5ef1604d" TYPE="ext4"
/dev/sdd1: LABEL="wd1tb" UUID="76D2-05BB" TYPE="vfat" PARTUUID="4d6d966b-01"
/dev/sde1: UUID="a06fed17-47a5-4ae9-85a1-416e4a4124a7" TYPE="ext4" PARTUUID="41c874ec-01"
your /dev/sdb1 is telling you it is NTFS. so you'll have to be sure that ntfs-3g is installed then use the -t ntfs-3g switch/argument when mounting it.

the difference between /dev/sdb and /dev/sdb1 . /dev/sdb is the entire device whereas /dev/sdb1 is a partition on said device. when using the dd program. This is one that you use the device name with. Most other operations like mounting and searching device you use the partition, and path to directory if wanted. I hope that helped give you a litte more insight.

Insight 2: when logged in as root you do not have to use the sudo command, that is being redundant
So when you say all drives should be listed (even USB HDD?), do you think it might be something wrong with the HDD? Because doing fdisk, it shows the drive (as mentioned in one of the previous posts)
sorry, what is ntfs-3g? something like add-in? should I install/download it? how?
 
Old 09-21-2016, 08:36 AM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,736

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
While Ubuntu installs NTFS support by default Redhat/CentOS does not. To install ntfs-3g in CentOS you need to enable the epel repository.

If the drive was not unmounted/ejected properly from Ubuntu then the filesystem might be corrupted. While ntfsfix can repair simple errors this might require chkdsk which requires a real windows computer.

Once you get this problem resolved you might want to switch to a linux filesystem if you never need to connect it to a Windows computer. This will require you to backup all the data somewhere since reformatting will essentially "erase" existing files.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Changing USB stick mount folder (possibly name of the drive?) lpallard Linux - Hardware 6 09-19-2010 10:08 AM
Force External USB HDD to mount to certain folder predatorz Linux - Hardware 4 06-18-2008 11:26 AM
Insert/remove USB disk leaves a permanent folder carbide Linux - General 3 03-25-2008 03:42 AM
Can't mount usb flash disk? ak-87 Slackware 13 05-19-2007 05:42 AM
How to mount my USB mobile disk malek_baklouti Linux - Software 13 04-23-2004 09:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration