doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

mounted USB HDD, can't CD to it?

Tue Feb 02, 2016 11:59 pm

I just downloaded & installed Raspian Jessie Lite Sunday night.

After mounting my USB hard drive and chmod'd the mounted folder to 775, I try to CD to it and depending on whether or not I use sudo, I get either permission denied or path not found. But yet I'm able to do an ls -l and see the contents of the HDD.
Here's the code I used to confirm what volumes are attached.

I'm hoping someone may be able to help me resolve this.

TIA!

Code: Select all

pi@raspiHome:~ $ sudo fdisk -l

Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 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
Disklabel type: dos
Disk identifier: 0xb3c5e39a

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        8192   131071   122880   60M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      131072 31116287 30985216 14.8G 83 Linux

Disk /dev/sda: 1.8 TiB, 2000398931968 bytes, 3907029164 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
Disklabel type: dos
Disk identifier: 0xa4f3f7d1

Device     Boot Start        End    Sectors  Size Id Type
/dev/sda1  *     2048 3907026943 3907024896  1.8T  7 HPFS/NTFS/exFAT
Here's the code I used to mount the HDD and chmod the mounted folder.

Code: Select all

pi@raspiHome:~ $ sudo mount /dev/sda1 /mnt
pi@raspiHome:~ $ sudo chmod 775 /mnt
chmod: changing permissions of ‘/mnt’: Read-only file system
pi@raspiHome:~ $
This shows the contents of the HDD.

Code: Select all

pi@raspiHome:~ $ sudo ls -l /mnt
total 102420
dr-x------ 1 root root      4096 Jul  3  2013 home
dr-x------ 1 root root      8192 Jul  4  2013 lib
dr-x------ 1 root root         0 Sep  2  2012 local
-r-------- 1 root root        26 Dec 16  2012 lock
dr-x------ 1 root root      4096 Jan 31 14:21 log
-r-------- 1 root root        28 Jan 30 22:20 mail
dr-x------ 1 root root         0 Dec 15  2012 opt
dr-x------ 1 root root         0 Jun  9  2013 python_scripts
dr-x------ 1 root root         0 Jan 30 20:48 $RECYCLE.BIN
-r-------- 1 root root        16 Dec 16  2012 run
dr-x------ 1 root root      4096 Nov 25  2013 shares
dr-x------ 1 root root         0 Jun  6  2013 spool
-r-------- 1 root root 104857600 Dec 16  2012 swap
dr-x------ 1 root root         0 Jan 31 23:29 System Volume Information
dr-x------ 1 root root         0 May 31  2013 tmp
dr-x------ 1 root root         0 Jun 24  2013 www
pi@raspiHome:~ $
Lastly, this is what I get when I try to cd to it.

Code: Select all

pi@raspiHome:~ $ cd /mnt
-bash: cd: /mnt: Permission denied
pi@raspiHome:~ $ sudo cd /mnt
sudo: cd: command not found
pi@raspiHome:~ $

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: mounted USB HDD, can't CD to it?

Wed Feb 03, 2016 12:22 am

I've continued to search on my own and just found this. It seems to help.

TIA!

viewtopic.php?p=171517#p171517

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: mounted USB HDD, can't CD to it?

Wed Feb 03, 2016 12:50 am

Hmmmmmm. That still doesn't work. :cry: :?

prior to doing the MOUNT, the mnt folder is owned by root. Then after the MOUNT, it's owned by pi.

Code: Select all

pi@raspiHome:/media $ ls -ld /mnt
drwxr-xr-x 2 root root 4096 Nov 21 18:50 /mnt
pi@raspiHome:/media $ sudo mount  -o uid=pi,gid=pi /dev/sda1 /mnt
pi@raspiHome:/media $ ls -ld /mnt
dr-x------ 1 pi pi 4096 Feb  1 00:17 /mnt
pi@raspiHome:/media $

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: mounted USB HDD, can't CD to it?

Wed Feb 03, 2016 1:30 pm

The file system is being mounted Read-Only. That's why you can't change the permissions.

Code: Select all

chmod: changing permissions of ‘/mnt’: Read-only file system
That's an error message, saying it couldn't make the change.

Is the file system NTFS? You probably need to mount it with the -t ntfs-3g option. You might need to install the ntfs-3g package with apt-get (or aptitude, or synaptic, or the new GUI package manager) first.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: mounted USB HDD, can't CD to it?

Wed Feb 03, 2016 1:35 pm

Is there a way to find out what system it's using? All I can find in frisk is something that seems to indicate that it's one of three: ntfs, ext4 or one that I don't remember.

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: mounted USB HDD, can't CD to it?

Wed Feb 03, 2016 1:41 pm

You could try (sudo) blkid, that reports file system types.

I don't think I've got an NTFS one to test here.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: mounted USB HDD, can't CD to it?

Wed Feb 03, 2016 1:42 pm

Thanks I'll try that when I get home.

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: mounted USB HDD, can't CD to it?

Wed Feb 03, 2016 1:45 pm

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 3907026943 3907024896 1.8T 7 HPFS/NTFS/exFAT
it is ntfs
so mount it like ^
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: mounted USB HDD, can't CD to it?

Wed Feb 03, 2016 4:29 pm

Hwy does it show as HPFS/NTFS/exFAT? I just found that confusing.

doni49
Posts: 94
Joined: Wed Jan 23, 2013 4:59 pm

Re: mounted USB HDD, can't CD to it?

Thu Feb 04, 2016 12:47 am

Thanks guys. I was able to get it working with the ntfs-3g setting.

Return to “Troubleshooting”