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.
Yes, thank you I know that, but what is the terminal way?
I tried "man boot", and several others-nothing.
How would I do it if I was stuck on runlevel 2/3??
As said above, you need to use fdisk (or a similar program). If my memory serves correctly, you need to open the related device and then use the "a" command.
Code:
fdisk /dev/sdd
# here you will enter the fdisk command line interface
a
And follow whatever instructions appear in your screen. It will surely ask you a partition number.
Anyway, as said above, this is a complete waste of time in most cases. Why do you think that you need to do this? Linux doesn't care at all about the bootable flag, only Windows and dos do as far as I know.
fdisk didn't work-I'm trying to set the bootable flag on a FAT16 USB device. Of course I could use Gparted, but what if I were in a non-X or terminal environment-how can I do it?
Will cfdisk do it?
I tried but couldn't.
fdisk didn't work-I'm trying to set the bootable flag on a FAT16 USB device. Of course I could use Gparted, but what if I were in a non-X or terminal environment-how can I do it?
Will cfdisk do it?
I tried but couldn't.
"Didn't work" tell us absolutely nothing about the problem.
I just tried:
Code:
# LC_ALL=C fdisk /dev/kingston
The number of cylinders for this disk is set to 2031.
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): p
Disk /dev/kingston: 2063 MB, 2063597568 bytes
32 heads, 62 sectors/track, 2031 cylinders
Units = cylinders of 1984 * 512 = 1015808 bytes
Disk identifier: 0x49e2a461
Device Boot Start End Blocks Id System
/dev/kingston1 1 1012 1003873 e W95 FAT16 (LBA)
Command (m for help): a
Partition number (1-4): 1
Command (m for help): p
Disk /dev/kingston: 2063 MB, 2063597568 bytes
32 heads, 62 sectors/track, 2031 cylinders
Units = cylinders of 1984 * 512 = 1015808 bytes
Disk identifier: 0x49e2a461
Device Boot Start End Blocks Id System
/dev/kingston1 * 1 1012 1003873 e W95 FAT16 (LBA)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
That little asterisk next to kingston1 means that the bootable flag is on.
Quote:
Originally Posted by linus72
Nope on sfdisk, just tried parted-but it said it couldn't set lop-back flags or something.
I guess Gparted is the only option?
That's paradoxic, because gparted is nothing else but a frontend to parted. So, if gparted works, then parted works.
Still we don't know what's the problem you are trying to solve by adding that flag. Are you trying to install Windows on your pendrive or something?
set partition flag state
Change the state of the flag on partition to state. Supported flags are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba", and "palo". State should be either "on" or "off".
If for example your usb device was /dev/sdb1 then the syntax would be:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.