Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I tried to install Arch Linux to an USB key. Things are kind of wobbly (it assumes the system has exactly one drive inside, for example) but everything installed just fine. Until I rebooted.

  Booting 'Arch Linux'

root (hd1,1)
 Filesystem type unknown, partition type 0x7
kernel /boot/vmlinuz26 root=/dev/dsb2 ro

Error 17: Cannot mount selected partition

(/dev/dsb1/(hd1,0) is a small FAT partition for data storing purposes -- for those locked down lab computers.)

Here's the 'Arch Linux' command sequence:

root (hd1,1)
kernel /boot/vmlinuz26 root=/dev/dsb2 ro
initrd /boot/kernel26.img

At the grub console:

grub> root (hd1,1)
 Filesystem type unknown, partition type 0x7
grub> cat /etc/passwd
 Error 17: Cannot mount selected partition
grub> root (hd0,1) # my ubuntu partition
 Filesystem type is ext2fs, partition type 0x73
grub> cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
<snip/>

I could successfully reboot in my host OS, Ubuntu, and used the Disk Tool to confirm partitioning was successful. Also, running sudo kvm /dev/dsb resulted in a successful Arch boot once I edited the commands to boot from root (hd0,1) (that is, until Arch tried to mount /dev/dsb2).

What did I do wrong?

Edit 1

From Ubuntu, fdisk -l /dev/sdb gives:

Disk /dev/sdb: 1998 MB, 1998585856 bytes
62 heads, 62 sectors/track, 1015 cylinders
Units = cylinders of 3844 * 512 = 1968128 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          65      124899    b  W95 FAT32
/dev/sdb2   *          66        1015     1825900   83  Linux

I have now read the related wiki section but nothing seems to apply: I didn't use GParted or logical drives; everything is on the same partition.

share|improve this question
    
Grub is saying it doesn't recognize the filesystem on (hd1,1). The partition type is set to 7 which is not normally used by Linux. What filesystem do you have on the Arch partition? What is the partition table on the USB disk (fdisk -l /dev/sdb)? –  Gilles Oct 30 '10 at 11:23
    
@Gilles pastebin.com/k6YXp1qu –  badp Oct 30 '10 at 11:33
    
(hd1) in Grub is not the disk you're looking for. What other disks do you have? Apparently you have a disk where partition 2 is type 7 (NTFS?). Grub1 is constrained by the BIOS interfaces, which can only report two hard disks, so you may have to look into your BIOS settings. Note that the disk ordering you see in Grub has nothing to do with the sda,sdb,... ordering in Linux (and the ordering in Linux depends on the order the drivers are loaded, so you might not get the same in Ubuntu and Arch). –  Gilles Oct 30 '10 at 11:46
    
@Gilles, you were right. It's (hd0,1) indeed. Make that comment an answer, please. –  badp Oct 30 '10 at 12:33
add comment

2 Answers

up vote 3 down vote accepted

The first thing to check in this situation is if the disk you're trying to boot from is the right one. The ordering of disks can depend on many factors:

  • In Grub1, you only get access to two hard disks. This is a limitation of the BIOS interface. Which two hard disks you actually get depends on your BIOS settings (look for something like “boot order”) and what disks and other hard-disk-like bootable media (e.g. USB flash drives) you actually have available.

  • Under Linux, the ordering of sda, sdb, etc., depends on the order in which drives are detected, which at boot time often depends on the order in which the drivers are loaded. Also, whether some disks appear as sd? or hd? depends on kernel configuration options and udev settings.

Here Grub is reporting a partition with type 7. While Linux and Grub don't care about partition types (except for “container” partitions such as extended partitions), it is unusual to have a Linux filesystem on a partition with type 7 (which fdisk describes as HPFS/NTFS). So my guess is that whichever drive your BIOS is offering as the second boot drive (Grub's hd1) is not the disk you want to boot, but some other disk with a Windows partition. Check if hd0 is the drive you want to boot from; if it's not, you'll have to change your BIOS settings.

If Grub recognizes the filesystem in a partition, you can type something like cat (hd1,1)/ and press Tab to see what files are there. This is the usual way of figuring out what filesystems you have where when you're feeling lost at a Grub prompt.


The second thing to check would be whether the partition you're trying to access is the right one — Grub1 counts from 0, Linux and Grub2 count from 1, and unusual situations (such as having a BSD installation) can cause further complications. Adding or removing logical partitions can cause existing partitions to be renumbered in a sometimes non-intuitive way.

If you had the right partition on the right disk, then Filesystem type unknown would indicate that the partition doesn't contain a filesystem that your version of Grub support. Grub1 supports the filesystems commonly used by Linux (ext2 and later versions, reiserfs, xfs, jfs) but (unless you have a recent patch) btrfs. Grub1 also doesn't support LVM, or RAID (except RAID-1, i.e. mirroring, since it looks like an ordinary volume when just reading).

share|improve this answer
add comment

I really recommend using grub2 and UUIDs here.

You can get UUIDs by

ls -l /dev/disk/by-uuid
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.