LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 01-08-2003, 06:12 PM   #1
qbdevel
LQ Newbie
 
Registered: Jan 2003
Location: Boulder, CO
Distribution: RH 7.1, RH 8.0
Posts: 3

Rep: Reputation: 0
Problem displaying MSDOS volume name


I have formatted a firewire hard drive with the following command:

/sbin/mkfs.msdos -F 32 -I /dev/sdb -n TEST_VOLUME

It formats correctly and when mounted on Windows or
Mac OS X correctly displays the label TEST_VOLUME.
However, I have not been able to find a way to access the
volume name on Linux.

Anyone know the magic incantation?

Thanks.
 
Old 01-08-2003, 07:02 PM   #2
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
What do you mean you want to access the volume name? Do you
want to be able to mount the disk using the volume name, or do you
want to be able to find out what is the volume name after it's been
mounted?
 
Old 01-09-2003, 10:18 AM   #3
qbdevel
LQ Newbie
 
Registered: Jan 2003
Location: Boulder, CO
Distribution: RH 7.1, RH 8.0
Posts: 3

Original Poster
Rep: Reputation: 0
The latter--after it's mounted I would like to be able to
display the volume name in a Java app, so either a Unix
command or a C program that can print it would be fine.
 
Old 01-09-2003, 09:20 PM   #4
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix, 98,2000 + various
Posts: 3,171

Rep: Reputation: 52
cfdisk will show a volume label, but i don't
know how to get it to list the info and exit.
I guess you could get the source take out
the part you want.
 
Old 01-10-2003, 07:43 PM   #5
qbdevel
LQ Newbie
 
Registered: Jan 2003
Location: Boulder, CO
Distribution: RH 7.1, RH 8.0
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the suggestion.

After much Googling and testing I came up with a solution that
does the job and seems fairly clean. The key is the mlabel
command, but rather than hardcoding every possible device
name into the mtools config file I create one on the fly that
defines only the device I'm interested in at the time I run the
commands. The following demonstrates the idea:

cat > /tmp/mtools.conf << EOF
drive c: file="/dev/sdb1"
EOF
MTOOLSRC=/tmp/mtools.conf
mlabel -s c: | awk '{ print $4 }'
rm /tmp/mtools.conf

BTW, if anyone is interested, the volname command can
be used to print the label for an ISO-9660 filesystem and
e2label prints the label for an ext2 filesystem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem displaying Bash array values. shinobi59 Programming 3 01-17-2006 06:45 PM
idesk problem - icons not displaying right cs-cam Linux - Software 0 01-21-2005 08:08 PM
Problem displaying KDE. Running on a Compaq 1800t Xoliath Linux - Laptop and Netbook 1 10-13-2004 04:07 PM
php4 problem _ downloading index.php instead of displaying tharris Debian 2 10-24-2003 07:13 PM
Problem with Displaying 8/24bit XWD Images yrraja Programming 2 04-22-2003 06:33 AM


All times are GMT -5. The time now is 08:51 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration