LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 05: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, 06: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: 50
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, 09: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, 08:20 PM   #4
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
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, 06: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



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 05:45 PM
idesk problem - icons not displaying right cs-cam Linux - Software 0 01-21-2005 07:08 PM
Problem displaying KDE. Running on a Compaq 1800t Xoliath Linux - Laptop and Netbook 1 10-13-2004 03:07 PM
php4 problem _ downloading index.php instead of displaying tharris Debian 2 10-24-2003 06:13 PM
Problem with Displaying 8/24bit XWD Images yrraja Programming 2 04-22-2003 05:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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