LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   a small problem in my script (https://www.linuxquestions.org/questions/linux-newbie-8/a-small-problem-in-my-script-4175672958/)

Davno 04-10-2020 03:17 PM

a small problem in my script
 
Hi,
I have this line in a script that used to work, but it needs to be modify because of the new M2 drive named New Volume instead of a UEFI name.
How can i modify the name New Volume, it does not work because of the blank space.
Code:

text x=75 y=815 sensor=disk format="%u" mountpoint="/media/normand/New Volume" color=250,250,250 font="Albany" shadow=1 fontsize=09
Thank you.

trewornan 04-10-2020 03:24 PM

Is this name defined in /etc/fstab?

Davno 04-10-2020 03:37 PM

Quote:

Originally Posted by trewornan (Post 6110081)
Is this name defined in /etc/fstab?

No, its not in fstab, the /etc/fstab is almost empty, my drives don't show there.

dmchess 04-10-2020 03:48 PM

When I mount a portable usb drive to my system, I do an ls on it first and see what the system tells me:

like so:

ls /media/terry

and hen I get output like this:

HP Portable Drive

then is the ls again, except I /H<tab> and then I get something like this:

ls /media/terry/HP\ Portable\ Drive/


Then I can use that string in my bash commands.

Terry

trewornan 04-10-2020 03:49 PM

Have you tried escaping the space:

mountpoint="/media/normand/New\ Volume"

sometimes you might even have to escape it twice:

mountpoint="/media/normand/New\\\ Volume"

no guarantees though.

trewornan 04-10-2020 04:09 PM

Also you could try changing the label/name perhaps to "New_Volume" or similar, there's a previous question on this forum about that:

https://www.linuxquestions.org/quest...tition-628528/

Davno 04-10-2020 04:41 PM

Quote:

Originally Posted by trewornan (Post 6110103)
Also you could try changing the label/name perhaps to "New_Volume" or similar, there's a previous question on this forum about that:

https://www.linuxquestions.org/quest...tition-628528/

All the other post did not work, so i think i will change the label.
How should i go about it, since the M2 drive has a drive letter in Windows 10 and its called New Volume in Linux.
P.S. It has important data on it.
Thanks

trewornan 04-10-2020 07:22 PM

sudo apt install parted
parted

then something like:

select /dev/???
print all
name Partition-number New_Volume

**!!!! BUT !!!** - I've never done this myself so you should look up the "parted" command and check it out for yourself, read the help, etc, and if the drive has important data (as you say) BACK IT UP before doing anything.

Davno 04-10-2020 07:28 PM

Disk Utility
 
I changed the name to New_Volume instead of New Volume, and now my script run.
Thanks


All times are GMT -5. The time now is 01:32 PM.