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 am using my mp3 player as a usb disk.
It is 1GB in volume.
I store files on it.
I would like to install GRUB on it and boot from it.
The label on it says its communication standard is USB 2.0 .
I checked the mp3 player’s properties on Win XP and it says
the file system is FAT.
I created "boot" and "grub" folders on it,
and copied the GRUB files into it.
I can write to the mp3 player with Windows XP
and with Debian GNOME, but I can't write to it
with Knoppix (live CD) and GRUB !
I can’t save the changes I make with GRUB or Knoppix.
The Win XP and Debian are installed on the H.D.
There is no operating system on the player.
I unmounted it and then remounted it again with
the command: "sudo mount -t vfat -w /dev/sda1 /media/usbdisk"
but it didn’t help.
When on Debian, I am able to activate the GRUB I copied to it,
and perform the command “root (hd1,0)”, but I get the message:
“filesystem type unknown, partition type0x6” .
I also performed the command "geometry (hd1,0)”
and got the message : “drive 0x81: C/H/S=1172/32/52,
The number of sectors=1950208, /dev/sdb Partition num:0,
filesystem type unknown, Partition type 0x6 “
I also tried the above with other disks and partitions,
Like (hd1), (hd1,1), (hd0,0) etc’ just to make sure I am not
missing the correct partition, but nothing worked.
I wonder if it is possible to activate GRUB from WinXP ?
Since WinXP detects the player's file system without any problem.
I installed GRUB on two other thumbdrives, and booted from them
Without any problem. They where both “SunDisk Cruzer Micro“,
one of them was formatted with FAT and the other with FAT32,
and I tried it on two completely different computers,
one is a “HP” PC at work, and the other is a “Asus” mobo
At home.
I searched for info on the net and I found some issues about
Mp3 players that are not detected by the BIOS or the operating system
and I was ready to give up, but what drives me crazy is that everything
is ok with BIOS, operating system, etc’.
The player is detected and I can write to it with the operating system.
The only problem is when I try to install GRUB on it!
I performed the command ”lsusb –v > {filename}” on it
and here is the result :
Bus 002 Device 003: ID 066f:8000 SigmaTel, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x066f SigmaTel, Inc.
idProduct 0x8000
bcdDevice 10.01
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 4
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Also, since you can access the mp3 player in Windows, you could maybe instead install "Grub4DOS" to the drive and use that, and also the "Grubinst" package to make it easy to install the Grub4DOS MBR to the drive. What errors do you get in Linux when you try to write to the drive?
Here is the result of the command "fdisk -l" on my computer:
======================
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 3212 25793747+ 7 HPFS/NTFS
/dev/hda2 3213 4486 10233405 83 Linux
/dev/hda3 4487 4865 3044317+ 82 Linux swap / Solaris
Note: sector size is 2048 (not 512)
Disk /dev/sdb: 998 MB, 998506496 bytes
32 heads, 52 sectors/track, 293 cylinders
Units = cylinders of 1664 * 2048 = 3407872 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 293 975000 6 FAT16
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 52) logical=(0, 1, 1)
======================
It's the 1st time I look at fdisk -l printout, so I don't
exactly know what I am seeing, but it seems ok, no ?
My mps player is there, it has a certain size and it has a filesystem
which is FAT16.
From which distro did you run the grub-install command? Did you try doing what the error suggested and use the grub-install command from the /usr/sbin/ directory instead? If you haven't tried that, try doing:
Code:
mount /dev/sdb1 /mnt
/usr/sbin/grub-install --root-directory=/mnt --recheck /dev/sdb
And see if that makes any difference. If not, you could instead do the following (while sdb1 is still mounted on /mnt):
I thought about doing what you just told me,
but I didn't have enough confidence/courage.
I was afraid that it might not install grub on the player,
but somewhere else, and perhaps run over the mbr.
I also looked at the content of the file device.map
on /mnt/boot/grub and it had a list of 3 devices: (fd0),(hda),(sdb)
while the device.map on /boot/grub had just a single entry: (hda)
I will look at /usr/sbin/ and see what I find there.
I did it from /usr/sbin/grub-install --root......
and it STILL didn't work.
It gave hte message:
"Probing devices to guess bios drives.
This may take a long time.
The file /mnt/boot/grub/stage1 not read correctly."
This is some kind of advance because it didn't say anything
about not running GRUB from /usr/sbin .
But why is it not reading the stage1 file ?
I used Windows and copied it again to the same location,
but it still coud not be read.
Here are the outputs of every code line
you asked me to run:
mount /dev/sdb1 /mnt -> there wasn't any output here. The command
just ran ok, and I actually accessed the content
of the MP3 player thru /mnt .
mkdir -p /mnt/boot/grub -> There wasn't any out put here.
The folders were created and I accessed them.
I don't understand the need for this command because
these folders were already there. I created them
when I tried to install GRUB to the player.
But I ran this command anyway.
cp /usr/lib/grub/*/* /mnt/boot/grub -> No output here either.
The command just ran ok.
grub -> GRUB was activated.
grub> root (hd1,0) -> After this command the out was:
"File system type unknown, partition type 0x6"
grub> setup (hd1) -> Here the output was: "Error 17: cannot mount selected partition"
grub> quit -> Here GRUB closed.
I don't understand why can't GRUB mount the partition.
Debian is able to mount the partition and I can access it and read
whatever is in there, but I can't write to it.
So you ran the Grub commands as root user, true? If so, then it looks like Grub can't mount the sdb1 partition; that is not a total surprise since fdisk previously reported that:
Quote:
Code:
Disk /dev/sdb: 998 MB, 998506496 bytes
32 heads, 52 sectors/track, 293 cylinders
Units = cylinders of 1664 * 2048 = 3407872 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 293 975000 6 FAT16
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 52) logical=(0, 1, 1)
I suppose you could try deleting your present FAT partition on the mp3 player with gparted, and then use gparted to create a new FAT partition to replace it; if that works, then probably Grub will be able to mount the partition. But it might be that doing so could cause the mp3 player to not recognize its own partition, and then you wouldn't be able to use it as an mp3 player after that. But if you are just using the mp3 player to store files, then it probably wouldn't be a problem.
Another option would be to try and install Grub4DOS to it instead as I previously mentioned; Grub4DOS generally has better NTFS/FAT support than legacy Grub. If you want to try that, how about posting:
Code:
fdisk -lu
hexdump -C -n 2048 /dev/sdb
I just want to check the MBR and first few sectors of the mp3 player drive to make sure it looks like we could install Grub4DOS to its MBR, and also make sure the sdb1 partition has enough free space in front of it to install the Grub4DOS MBR. I would recommend that we try Grub4DOS before you reformat the mp3 player with a new partition, but let me know what you want to do.
> So you ran the Grub commands as root user, true?
Yes. It is true.
I logged into the Debian installation as root, and performed the commands.
Following are redirections of the outputs of the command you asked me to run.
========================
The command "fdisk -lu" :
(please notice that the 2002MB disk marked as /dev/sda
is the usb stick I booted from. This disk is not the issue.
The issue is the 998MB sdb disk).
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders, total 78165360 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 63 51587557 25793747+ 7 HPFS/NTFS
/dev/hda2 51600780 72067589 10233405 83 Linux
/dev/hda3 72067590 78156224 3044317+ 82 Linux swap / Solaris
Note: sector size is 2048 (not 512)
Disk /dev/sdb: 998 MB, 998506496 bytes
32 heads, 52 sectors/track, 293 cylinders, total 487552 sectors
Units = sectors of 1 * 2048 = 2048 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 52 487551 975000 6 FAT16
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 52) logical=(0, 1, 1)
Disk /dev/sda: 2002 MB, 2002255360 bytes
4 heads, 16 sectors/track, 61103 cylinders, total 3910655 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 16 3910654 1955319+ e W95 FAT16 (LBA)
Just to let you know,
I tried grub4dos, it's a nice thing.
I installed it on few pendrives and booted
WinXP from them with no problem. I tried it on few computers.
I also tried to install it on my mp3player and it didn't work.
I guess my mp3 player is a hopeless case.
The installation offered me the option "--skip-mbr-test" and I used it,
but it didn't boot.
Babypeng, how did you try to install Grub4DOS to your mp3 player? If you used their own installer and it failed, I think a better option would be to try and use "dd" to copy the Grub4DOS MBR to your mp3 player. In other words, if you navigate to the Grub4DOS-0.4.4 directory where the "grldr.mbr" file is, you could do:
That should install the Grub4DOS MBR to your sdb mp3 player. Then you just need to put the "grldr" and "menu.lst" files in the sdb1 partition, and see if it boots. If you decide to give it a try, let me know how it goes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.