Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
(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.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679
Rep:
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.
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?
@ 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:
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,679
Rep:
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 ).
[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:
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.
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.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
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.
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.