LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-31-2017, 12:12 PM   #1
gilliat
LQ Newbie
 
Registered: Jul 2016
Posts: 8

Rep: Reputation: Disabled
Question usb format for mp3 reader


I had some music on a 1Go usb drive
I removed all the mp3 in there to put some new ones
I had some write access (beeing root) pbs with some files in hidden dirs (.Trash or something ...), it says read-only file system....
so I decided to low level format the drive:
Code:
dd if=/dev/zero of=/dev/sdb
right after that, I made a new whole primary partition with cfdisk: I used all the possible space.

then I tried the following commands but none of them work, the hi-fi mp3 reader cannot read a song anymore.

Code:
mkfs.fat /dev/sdb1 && file -s /dev/sdb1
output:
Code:
/dev/sdb1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 62, heads 31, hidden sectors 2048, sectors 1954687 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 1906, serial number 0x61de4d85, unlabeled
I use blkid as well to check out if the drive is formated correctly:
Code:
'blkid | grep -i sdb'
=> NO SONG

Code:
mkfs.fat -F 32 -I /dev/sdb1 && file -s /dev/sdb1
output:
Code:
/dev/sdb1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 62, heads 31, hidden sectors 2048, sectors 1954687 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 1906, serial number 0x72d497fb, unlabeled
=> NO SONG

Code:
mkfs.vfat /dev/sdb1 && file -s /dev/sdb1
output:
Code:
/dev/sdb1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 62, heads 31, hidden sectors 2048, sectors 1954687 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 1906, serial number 0x822db289, unlabeled
=> NO SONG

Code:
mkfs.fat -F 16 -I /dev/sdb1 && file -s /dev/sdb1
output:
Code:
/dev/sdb1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 32, root entries 512, Media descriptor 0xf8, sectors/FAT 256, sectors/track 62, heads 31, hidden sectors 2048, sectors 1954687 (volumes > 32 MB) , serial number 0x936ca339, unlabeled, FAT (16 bit)
=> NO SONG

I even tried ntfs (but I am pretty sure it was not ntfs formated last time it worked out).
Code:
mkfs.ntfs /dev/sdb1 && file -s /dev/sdb1
output:
Code:
Cluster size has been automatically set to 4096 bytes.
Initializing device with zeroes:  1% ...100% - Done
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.
/dev/sdb1: DOS/MBR boot sector, code offset 0x52+2, OEM-ID "NTFS    ", sectors/cluster 8, Media descriptor 0xf8, sectors/track 62, heads 31, hidden sectors 2048, dos < 4.0 BootSector (0x80), FAT (1Y bit by descriptor); NTFS, sectors/track 62, sectors 1954686, $MFT start cluster 4, $MFTMirror start cluster 122167, bytes/RecordSegment 2^(-1*246), clusters/index block 1, serial number 01cde7a954cb182fd; contains Microsoft Windows XP/VISTA bootloader BOOTMGR
=> NO SONG

I tried a last time with a label:
Code:
mkfs.vfat -F 32 -n ZIC -I /dev/sdb1 && file -s /dev/sdb1
output:
Code:
/dev/sdb1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 62, heads 31, hidden sectors 2048, sectors 1954687 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 1906, serial number 0xdc60fa11, label: "ZIC        "
=> NO SONG

(just for your info), I always follow these steps:
- insert usb key into pc
- umount it because of auto-mount
- check the partition is umounted
- mkfs
- mount the device
- copy a mp3 to the device
- check the copy is all right
- umount the device
- make a test on a hi-fi mp3 reader.

If it does not work, I re-try from mkfs.
Just once I did all the processus over again from cfdisk: In cfdisk, instead of the default type (which is ext3), I chose DRDOS (FAT 16 < 32 M) but it did not work either.

I tried the usb under windows, it works and the mp3 can be read.

I do not know what else I can try. any idea folks??? thank you so much to help.
 
Old 05-31-2017, 02:11 PM   #2
kudsu
Member
 
Registered: Apr 2017
Location: from LA
Distribution: Slackware and anything
Posts: 50

Rep: Reputation: Disabled
Just a shot in the dark

How are your permissions. Are you root?
 
1 members found this post helpful.
Old 05-31-2017, 03:06 PM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Seems you may not have made a new partition after wiping the disk with "dd if=/dev/zero of=/dev/sdb", what does "fdisk -l" show? How was the partition created?
I also don't see any steps explaining how you are copying songs onto the new file system.
 
1 members found this post helpful.
Old 05-31-2017, 03:29 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,984

Rep: Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678Reputation: 5678
Post the make/model of your HiFi device. There might be some specific limitations on the number of directories/files/naming, type of MP3 i.e bit rate, CBW versus VBW etc that the player can read.

Make sure the partition ID is for a FAT32 i.e C (hex value). linux does not care and if it was not correct I would expect Windows to pop an error box requesting to format the drive. If you format the drive in windows and it works can you then insert it in your linux box and copy a MP3? What happens when you try to play the file in the MP3 reader?
 
1 members found this post helpful.
Old 05-31-2017, 04:52 PM   #5
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,938

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
I always use the GUI program gparted for these things.

Just noticed you said hi-fi device - is FAT32 suitable for hi-fi???

Last edited by JeremyBoden; 05-31-2017 at 04:54 PM.
 
2 members found this post helpful.
Old 05-31-2017, 05:06 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,838
Blog Entries: 13

Rep: Reputation: 4893Reputation: 4893Reputation: 4893Reputation: 4893Reputation: 4893Reputation: 4893Reputation: 4893Reputation: 4893Reputation: 4893Reputation: 4893Reputation: 4893
I feel a lot of the earlier responses are right on the mark.

You need to use sudo or be root.

You need to create a partition before you can create a file system.

You can consider fdisk which is needed prior to the mkfs.

The use of gparted will help things immensely if you happen to have difficulties with command line operations.
 
Old 06-01-2017, 01:14 PM   #7
gilliat
LQ Newbie
 
Registered: Jul 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
@ kudsu
with permissions set to default, you cannot dd, nor cfdisk nor mkfs. So yes I am root.

@273
as I said, I made a new whole partition with cfdisk before mkfs.
but please, continue reading because you put me on a lead and you may be very surprised.

@michaelk
it's one of the smallest philips hi-fi. before I put approximatively 1 hundred mp3 files int the usb drive root (no folders) and it worked out perfectly.
for this test, I put only 1 mp3 file on the drive.

as I said, I tried the usb on windows and there was no pbs at all: mp3 could be read both under linux and windows

@JeremyBoden
cfdisk is maybe better than a gui; you just need 4 buttons to handle it: 'tab','enter','up/down arrow'.
fat32 should be used for usb, particulary if volume is > 2Go. Anyway I tried, fat16,fat32 and ntfs.

@rtmistler
You need to use sudo or be root -> yes I was (see above)
You need to create a partition before you can create a file system -> Yes I did (as I said).
You can consider fdisk which is needed prior to the mkfs. -> I used cfdisk, but next time I will try fdisk, sure thing.
The use of gparted will help things immensely if you happen to have difficulties with command line operations. -> trust me, you cannot make simpler than cfdisk.

Anyway, I thank you so much guys because you put me on the right lead:
@273 said you may not have made a partition after wiping the volume.
I was just wondering wether it could be possible to format without partitioning before (the way I understand things, it should not work, right?)
so I did the following
dd if=/dev/zero of=/dev/sdb
output:
dd: writing to ‘/dev/sdb’: No space left on device
1956736+0 records in
1956735+0 records out
1001848320 bytes (1.0 GB) copied, 376.86 s, 2.7 MB/s

after I check out with cfdisk (it says "device does not contain a recognized partition table..."). I just quit cfdisk and did nothing there (ctrl C)

I check out with blkid:
blkid /dev/sdb (there is no output at all!)

I check out with file cmd and nothing either:
file -s /dev/sdb
output:
/dev/sdb: data (nothing as well).

Now I mkfs:
mkfs.vfat -I /dev/sdb
and check out the result:

blkid /dev/sdb
output:
/dev/sdb: UUID="1C00-262E" TYPE="vfat"

file -s /dev/sdb
output:
/dev/sdb: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 62, heads 31, sectors 1956735 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 1908, serial number 0x1c00262e, unlabeled

mount /dev/sdb /mnt
cp /path/to/file.mp3 /mnt
umount /dev/sdb

and guess what? it WORKS!!!!!
but it only works with '-I' options with mkfs.

thanx folks !!

Last edited by gilliat; 06-01-2017 at 01:21 PM.
 
Old 06-01-2017, 01:23 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
I'm glad it worked out for you, have to admit I missed that you created the partition because you only typed you did it but didn't list the command.
I was actually looking for things like errors creating the partition or letters or numbers in each not agreeing (as per your reply above ).
 
Old 06-01-2017, 01:26 PM   #9
gilliat
LQ Newbie
 
Registered: Jul 2016
Posts: 8

Original Poster
Rep: Reputation: Disabled
[QUOTE=gilliat;5717921]@ kudsu
with permissions set to default, you cannot dd, nor cfdisk nor mkfs. So yes I am root.

@273
as I said, I made a new whole partition with cfdisk before mkfs.
but please, continue reading because you put me on a lead and you may be very surprised.

@michaelk
it's one of the smallest philips hi-fi. before I put approximatively 1 hundred mp3 files int the usb drive root (no folders) and it worked out perfectly.
for this test, I put only 1 mp3 file on the drive.

as I said, I tried the usb on windows and there was no pbs at all: mp3 could be read both under linux and windows

@JeremyBoden
cfdisk is maybe better than a gui; you just need 4 buttons to handle it: 'tab','enter','up/down arrow'.
fat32 should be used for usb, particulary if volume is > 2Go. Anyway I tried, fat16,fat32 and ntfs.

@rtmistler
You need to use sudo or be root -> yes I was (see above)
You need to create a partition before you can create a file system -> Yes I did (as I said).
You can consider fdisk which is needed prior to the mkfs. -> I used cfdisk, but next time I will try fdisk, sure thing.
The use of gparted will help things immensely if you happen to have difficulties with command line operations. -> trust me, you cannot make simpler than cfdisk.

Anyway, I thank you so much guys because you put me on the right lead:
@273 said you may not have made a partition after wiping the volume.
I was just wondering wether it could be possible to format without partitioning before (the way I understand things, it should not work, right?)
so I did the following
dd if=/dev/zero of=/dev/sdb
output:
dd: writing to ‘/dev/sdb’: No space left on device
1956736+0 records in
1956735+0 records out
1001848320 bytes (1.0 GB) copied, 376.86 s, 2.7 MB/s

after I check out with cfdisk (it says "device does not contain a recognized partition table..."). I just quit cfdisk and did nothing there (ctrl C)

I check out with blkid:
blkid /dev/sdb (there is no output at all!)

I check out with file cmd and nothing either:
file -s /dev/sdb
output:
/dev/sdb: data (nothing as well).

Now I mkfs:
mkfs.vfat -I /dev/sdb
and check out the result:

blkid /dev/sdb
output:
/dev/sdb: UUID="1C00-262E" TYPE="vfat"

file -s /dev/sdb
output:
/dev/sdb: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 62, heads 31, sectors 1956735 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 1908, serial number 0x1c00262e, unlabeled

mount /dev/sdb /mnt
cp /path/to/file.mp3 /mnt
umount /dev/sdb

and guess what? it WORKS!!!!!
but it only works with '-I' options with mkfs.

Many thanx folks !!
 
Old 06-01-2017, 05:56 PM   #10
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I can't figure out, and I'm sure no one else can either, what the purpose of
Code:
file -s
is in your examples. And I'm pretty sure you'll need to actually write files to the drive in order for there to be any on it.
 
Old 06-01-2017, 06:09 PM   #11
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Is there no song on an mp3 player? Can the mp3 player format the drive? Be sure to DOS partition and probably mkfs.fat -F 16 depending on how OLD the mp3 player is. Also older readers could only read up to a certain sized card. Which would be a hardware limit. Try making the first partition only 2GB and leaving the rest of the card unallocated. Then mkfs and the likes.

Edit: actually 2GB since that is the max size for a partition with Fat16. But try 4GB, 8GB, and such if Fat32.

Last edited by Shadow_7; 06-01-2017 at 09:11 PM.
 
Old 06-01-2017, 07:22 PM   #12
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,938

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
Originally Posted by AwesomeMachine View Post
I can't figure out, and I'm sure no one else can either, what the purpose of
Code:
file -s
is in your examples. And I'm pretty sure you'll need to actually write files to the drive in order for there to be any on it.
According to the file man page,
Quote:
-s, --special-files
Normally, file only attempts to read and determine the type of argument files which stat(2) reports are ordinary
files. This prevents problems, because reading special files may have peculiar consequences. Specifying the -s
option causes file to also read argument files which are block or character special files. This is useful for
determining the filesystem types of the data in raw disk partitions, which are block special files. This option
also causes file to disregard the file size as reported by stat(2) since on some systems it reports a zero size for
raw disk partitions.
So
Code:
sudo file -s /dev/sda1
gives me
Quote:
/dev/sda1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkdosfs", sectors/cluster 8, Media descriptor 0xf8, sectors/track 63, heads 255, sectors 2097152 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 2048, reserved 0x1, serial number 0x91b7fe06, label: "ESP "
 
Old 06-02-2017, 06:29 PM   #13
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Yes, it does. But why do you need that as part of a format command? I never needed it to formate a drive. The answer is you don't need it. The drive will format whether or not that extra output is produced. It has nothing to do with formatting the drive.
 
Old 06-03-2017, 08:25 AM   #14
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,938

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
It indicates that the partition was successfully formatted with a file system.
Of course you don't need to use it, since it only answers an existential question...
 
Old 06-03-2017, 07:33 PM   #15
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I guess I'm just too trusting.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert rm format music files to mp3 format me4linux Linux - Software 2 05-15-2007 02:45 PM
Speaking of .ogg vs .mp3 - .mp3 format now the center of legal battles Shadoglare Linux - News 1 04-16-2007 12:02 PM
Linux FORMAT Reader Awards 2006 : Vote for LQ! vangelis Linux - News 2 01-28-2006 07:51 AM
Converting wma format to mp3 format. fakie_flip Linux - General 6 10-02-2005 08:49 PM
from audi format to mp3 format stanev Debian 2 01-25-2005 10:18 AM

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

All times are GMT -5. The time now is 05:08 AM.

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