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'm trying to clone a partition and make it a bootable usb. I've made two ext3 partitions (just like the installation I'm cloning).

The first one is small and has grub/ and the kernel.

The second partion is large and contains /.

I need to modify the fstab to fit the new usb device and I'm not really sure how to do that.

The old fstab looks like this:

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>
/dev/nfs                /               rootfs          noauto,rw       0 0
tmpfs                   /var/run        tmpfs           defaults        0 0
tmpfs                   /var/lock       tmpfs           defaults        0 0
tmpfs                   /tmp            tmpfs           defaults        0 0

# Mount the POSIX mqueue filesystem
none                    /dev/mqueue     mqueue          defaults        0 0

When I try to run grub-install /dev/sdc I get:

/usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).

I got this idea from this question

I also get this on another machine when I run grub install:

/dev/nfs: Not found or not a block device.
share|improve this question
    
You have misunderstood the concept, when you install grub onto another device, fstab on that device is not concerned, it only regards current /proc/mounts, did you mount /dev/sdc ? –  warl0ck Jul 29 '12 at 0:37
    
Your fstab root entry is nonsense; there is no such thing as /dev/nfs or rootfs. –  psusi Nov 26 '12 at 2:44

1 Answer 1

You can add a USB device for /boot the same as any other block device. I have a USB key that I use to boot a system encrypted disk, here's the relevant line from /etc/fstab

# /etc/fstab
# <file system> <dir>   <type>  <options>   <dump>  <pass>
UUID=0079f3b9-7cd6-4dd3-8fb3-a03c8a722d72 /boot ext2  defaults 0 0

Are you trying to install from a chroot? Booting from sysrescuecd? A live cd?

Does your USB have an MBR?

If so, you need to follow the chroot cookbook

Boot from livecd or sysrescuecd (make sure your booting from either 32bit or 64bit to match the installed system)

mount your-root-device /mnt # <- substitute your-root-device, eg /dev/sda1
mount --rbind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
chroot /mnt /bin/bash
# double check USB stick device 
mount your-boot-usb-PARTITION /boot # <- substitute your-boot-device
grub-install /dev/sdc

If this fails, you need to post more details.

Which distro, how are you booting, what's the hardware, etc.

See asking a good question

share|improve this answer

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.