this post was submitted on 09 May 2024
25 points (96.3% liked)

linux4noobs

1356 readers
1 users here now

linux4noobs


Noob Friendly, Expert Enabling

Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.


Seeking Support?

Community Rules

founded 1 year ago
MODERATORS
 

Hey guys, so i just now pulled the trigger, formatted my windows installation and installed Linux for the first time. I went with bazzite, which seems very gaming friendly and idiot proof with its rollback functionality.

Now to the issue: I have 3 drives in my computer, one 500gb SSD which i used for the OS. This one can be accessed fine as expected. The other two, a 2tb SSD and 1tb HDD however, dont. I cant seem to find a way to access them, and i have all my media on there / want to install games onto them.

How can i access them, and tell the OS that these two are also part of its system?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 6 months ago (1 children)

Here's the documentation I created for myself seventeen years ago. It's from the perspective of a Mac user with hardly any command-line knowledge, so I was distilling things I'd learned researching all over the web that morning. Some of it may be inaccurate on technical details due to my finite understanding at the time. Hope this helps.

Mounting noauto drives using diskutil.

The challenge is how to automate the mounting of drives that have a noauto configuration in /bin/fstab.

One would normally mount these drives by using diskutil list to display the device-id of the unmounted drives. The drives could then be mounted by using diskutil mount device-id. Unfortunately, the device-id is not static and this is ,therefore, not viable for automation. The solution is to employ a shell script to mount the drives by their name.

	Steps:
	1. Create shell script in /bin/
	2. Make the script an executable
	3. Add to cron

Step 1: Creating the shell script Start by creating the script in the directory /bin/

	sudo vi /bin/mounter.sh

The following is the basis for the shell script:

	#!/bin/bash
	theDisk=`diskutil list | awk ‘/diskName/ {print $NF}’`
	diskutil mount $theDisk

Using this code, mounter.sh would be able to mount the disk "120GB" by calling its name anywhere in the command line. However, any call to diskutil run through cron will result in the following notification to /var/mail/danyoung :

	/bin/mounter.sh: line 1: diskutil: command not found
	/bin/mounter.sh: line 3: diskutil: command not found

The solution is use of an absolute path, as cron does not run as a shell environment. The call must be made as:

	/usr/sbin/diskutil

The completed shell script looks like this:

	#!/bin/bash
	theDisk=`/usr/sbin/diskutil list | awk ‘/diskName/ {print $NF}’`
	/usr/sbin/diskutil mount $theDisk

Step 2: Make executable After saving the file it must be made an executable:

	sudo chmod +x /bin/mounter.sh

Step 3: Add to cron Add the script to cron using Cronnix. The command to execute is simply the path to the shell script:

	/bin/mounter.sh

Further notes:

The shell script was discovered in an example at radiotope.com but was missing the absolute path. The solution of using an absolute path was given in a forum at macosxhints.com. The exact pages follow: 1. http://www.radiotope.com/writing/?p=64 2. http://forums.macosxhints.com/showthread.php?s=b0306f161f40e5ea07b2eea9f18ad2f2&t=60811

Additional information about writing a first shell script and making it executable was at the following: 1. http://www.macdevcenter.com/pub/a/mac/2002/07/02/terminal_5.html

[–] [email protected] 2 points 6 months ago (1 children)

Whats the difference between using backticks for the definition of theDisk and $() ?

[–] [email protected] 3 points 6 months ago* (last edited 6 months ago)

The backticks are an old way of creating a variable that is no longer considered good form. But I didn't know any better at the time.