LinuxQuestions.org
Review your favorite Linux distribution.
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 04-11-2022, 08:45 AM   #1
tg0000
Member
 
Registered: Jul 2009
Location: Philippines
Distribution: Linux Mint 20.3 Una, MATE 1.26.0
Posts: 63
Blog Entries: 1

Rep: Reputation: 12
Navigate to disk in BASH


I'm a bit embarrassed that I can't figure this out on my own. I know how to change directories in BASH but I can't seem to figure out how to change to another disk.

In this case I want to switch to /dev/sdb1 so I tried CD /dev/sdb1 which tells me it's not a directory.

Can you show me the error of my ways?

And yes I promise I read over a few basic tutorials like the one below.
https://www.pluralsight.com/guides/b...igation-manual
 
Old 04-11-2022, 08:54 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
linux does not use the concept of disks like windows. The analogy is that the system is arranged like a tree with the / being the trunk. All other filesystems are attached to root as mount points which is just a directory.

Now days depending on the distribution, desktop an external drives are automatically mounted within /media. you can check using the lsblk command. If not automatically mounted you can mount it manually.

If it isn't an external drive then you will probably need to manually mount the drive. More information might be required.

Last edited by michaelk; 04-11-2022 at 08:56 AM.
 
1 members found this post helpful.
Old 04-11-2022, 09:09 AM   #3
tg0000
Member
 
Registered: Jul 2009
Location: Philippines
Distribution: Linux Mint 20.3 Una, MATE 1.26.0
Posts: 63

Original Poster
Blog Entries: 1

Rep: Reputation: 12
/dev/sdb1 appears to be mounted since I can access it in the GUI file manager. But I still get the same error attempting to access it in BASH.
 
Old 04-11-2022, 09:21 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
because you need to cd into the mount point, not into the device (/dev/sdb1).
 
1 members found this post helpful.
Old 04-11-2022, 09:22 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
/dev/sdb1 is a device name, not a mount point.

Look at the output of the lsblk command. Does a mount point show up for /dev/sdb1?

Depending on distribution / version it might automatically be mounted to /run/username/.. or some other obscure path.
 
1 members found this post helpful.
Old 04-11-2022, 09:37 AM   #6
tg0000
Member
 
Registered: Jul 2009
Location: Philippines
Distribution: Linux Mint 20.3 Una, MATE 1.26.0
Posts: 63

Original Poster
Blog Entries: 1

Rep: Reputation: 12
It shows the mount point as ... GoldStandard_NTFS


Code:
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
└─sda1   8:1    0 465.7G  0 part /sysroot
sdb      8:16   0   1.8T  0 disk 
├─sdb1   8:17   0   1.4T  0 part /run/media/dada/GoldStandard_NTFS
└─sdb2   8:18   0   466G  0 part /run/media/dada/Gold_FAT
zram0  252:0    0   5.5G  0 disk [SWAP]
*Edit ...

cd /run/media/dada/GoldStandard_NTFS worked thanks :-)

Last edited by tg0000; 04-11-2022 at 09:39 AM. Reason: Found solution.
 
Old 04-11-2022, 09:39 AM   #7
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,145
Blog Entries: 6

Rep: Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832
You can see what the device node of a disk is with:
Code:
dmesg -w
Then plug the hard drive in. The device node will show in the dmesg terminal.
Then you can mount the filesystem somewhere if you want to.

Example:
Code:
mount /dev/sdb1 /mnt/somewhere
cd /mnt/somewhere
ls
If you have an auto mounter running, then it probably is already somewhere in /mnt

look at:
man mount
man cd
man ls
man dmesg
man cp
man mv

Edit:
Oh too late.

Quote:
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 1.4T 0 part /run/media/dada/GoldStandard_NTFS
└─sdb2 8:18 0 466G 0 part /run/media/dada/Gold_FAT

Last edited by teckk; 04-11-2022 at 09:40 AM.
 
1 members found this post helpful.
  


Reply

Tags
bash, navigation



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
LXer: goto - a bash utility to navigate faster to aliased directories supporting auto-complete LXer Syndicated Linux News 1 03-05-2018 07:21 PM
system freezes when I navigate to /mnt warkrime Linux - Distributions 2 07-15-2003 01:25 PM
Unable to navigate the web. garthron Linux - Networking 1 05-08-2003 03:32 AM
what's the best way to navigate around linux? chansky Linux - Newbie 3 09-25-2002 05:38 PM
dialup ISP connects but can't navigate med Linux - Newbie 0 03-08-2002 07:51 AM

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

All times are GMT -5. The time now is 06:26 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