LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-20-2008, 06:42 AM   #1
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Rep: Reputation: 31
how to a bootable flag on usb stick?


Hi!

I've tried to set a bootable flag on a usb stick using fdisck but it doensn't seem to work:
Quote:
sudo /sbin/fdisk /dev/sda1

Command (m for help): a
Partition number (1-4): 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
Then when I try to install the XO-LiveCD on it, I get the error message:
Quote:
sudo ./make_usbstick.sh -n 0 -i -d /dev/sda1
device /dev/sda1 does not have bootable flag set
How should I manage this?
thanks in advance for any advice.
 
Old 08-20-2008, 07:07 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,127

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Huh ???.
Why ...

Linux doesn't use the boot flag. And fdisk doesn't take a partition as a parm - use /dev/sda
 
Old 08-20-2008, 07:59 AM   #3
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by syg00 View Post
- use /dev/sda
what do you mean exactly?
 
Old 08-20-2008, 10:12 AM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by xpucto View Post
what do you mean exactly?
Use
Code:
fdisk /dev/sda
instead of
Code:
fdisk /dev/sda1
When you want to edit the partition table, you use the device name for the drive, not the device name for an individual partition.
 
Old 08-27-2008, 05:58 AM   #5
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
I did so but got the following error:
Quote:
sudo /sbin/fdisk /dev/sda

The number of cylinders for this disk is set to 2796.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): a
Partition number (1-4): 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
What did I do wrong?
thanks in advance
 
Old 08-27-2008, 07:30 AM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 62
That looks fine, but if you want to boot from the device, you will need some sort of boot sector like syslinux. syslinux was the only thing I managed to get working with my USB stick when I installed ubuntu onto it, although I should point out that I had to get a customised kernel/initrd to get it working.
 
Old 08-27-2008, 08:26 AM   #7
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by xpucto View Post
What did I do wrong?
You probably modified the partition table while the USB stick was still mounted. That is usually the cause of
Quote:
Originally Posted by xpucto View Post
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
Once you "unmount" the thumb drive and "eject" it, the new partition table will be used the next time you insert it.
 
Old 08-28-2008, 05:16 AM   #8
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by David1357 View Post
Once you "unmount" the thumb drive and "eject" it, the new partition table will be used the next time you insert it.
that's what I did, but then I get the following error when trying to make the tick bootable:
Quote:
you need to start fdisk or parted and set the bootable flag
on device partition /dev/sda1
I try to install XO-LiveCD with th script ./make_usbstick.sh :
Quote:
sudo ./make_usbstick.sh -h

Make a bootable LiveBackup on USB Memory Stick

SYNOPSIS:
./make_usbstick.sh [-d <usbdevice>] [-n <partition>] [-m <master-directory> ] [-h] [-u] [-i | -g]

-d <device> usb device, default: /dev/sda
-n <partition> partition number to be used, default: 1
use 0 for if you don't have a partition table
-m <master-directory> LiveBackup master directory, default: /mnt/media
if you convert a Live-CD this is the CD mount point
-c <bootloader-config-file> default: /mnt/media/boot/isolinux/isolinux.cfg
-h help
-u update an already prepared stick
-s speedup updates, copy system images only if they differ in size
-i use isolinux bootloader, (recommended for general purpuse)
-g use grub bootloader, (recommended for development)

EXAMPLE:
./make_usbstick.sh -n 1 -i -d /dev/sda

this will copy the content from /mnt/media
to the first partition of device /dev/sda and use the isolinux bootloader
But I get either
Quote:
sudo ./make_usbstick.sh
which: no parted in (/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/christophe/bin)
INFO: you need to start fdisk or parted and set the bootable flag
on device partition /dev/sda1
or
Quote:
sudo ./make_usbstick.sh -n 0
device /dev/sda does not have bootable flag set
What may I do?
Thanks in advance for your help.
 
Old 08-28-2008, 08:12 AM   #9
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by xpucto View Post
Code:
which: no parted in (/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/christophe/bin)
What may I do?
Your real problem is you need parted for the script to operate properly. Install parted. If it is already installed, add it to your path.
 
Old 08-29-2008, 06:25 AM   #10
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by David1357 View Post
Your real problem is you need parted for the script to operate properly. Install parted. If it is already installed, add it to your path.
Thank you! I didn'see the message regarding parted. That was indeed the problem. Now I'm faced with another one. The problem is that the error maessage isn't saying much and I don't know what the problem could be :
Quote:
sudo ./make_usbstick.sh
Attempting to run 'parted /dev/sda set 1 boot on'... DONE
File: Readme.LiveBackup was not found on /mnt/media
Please check your configuration !!!
Any idea maybe?

thanks in advance.
 
Old 08-29-2008, 08:52 AM   #11
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by xpucto View Post
Any idea maybe?
Start digging through "make_usbstick.sh" and look for the line that checks for "Readme.LiveBackup".
 
  


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
Making a usb stick bootable TotalLinuxNoob Linux - Software 2 01-05-2008 11:03 AM
How to make USB stick bootable? depam Linux - Software 3 12-31-2006 11:22 AM
make a USB stick bootable lothario Linux - Software 1 07-13-2006 01:02 PM
create bootable linux for usb memory stick mikequinlan Linux - Software 1 05-20-2006 07:38 AM
bootable USB-Stick overlord73 Linux - Hardware 1 01-14-2005 02:17 AM


All times are GMT -5. The time now is 07:33 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration