[Klug-general] Setting Boot Flag

Andrew Miller (Spode) spode at thinkbikes.com
Tue Mar 4 16:00:57 GMT 2008


A very good point, thank you.

Karl Lattimer wrote:
> One last thing, you should really be careful of the a command in fdisk,
> its a "toggle" function, which would mean you should check before you
> set.
>
> K,
>
>
> On Tue, 2008-03-04 at 15:56 +0000, Andrew Miller (Spode) wrote:
>   
>> Yeah, I was thinking that. But it's still using an interim file. It's a 
>> little messy really. But it'll have to do for the moment.
>>
>> Cheers Karl.
>>
>> Karl Lattimer wrote:
>>     
>>> On Tue, 2008-03-04 at 15:52 +0000, Andrew Miller (Spode) wrote:
>>>   
>>>       
>>>> I'm using BusyBox, so scripting for sh compatibility.
>>>>
>>>> Thanks for steering me in the right direction here. Is there a way of 
>>>> putting the script into a variable and inputting that instead of having 
>>>> to use an interim file? As far as I can see fdisk < input.script will 
>>>> only work with a real file..
>>>>     
>>>>         
>>> urgh, something like this perhaps...
>>>
>>> cat > /tmp/setboot.fdisk << EOF
>>> a
>>> 1
>>> EOF
>>>
>>> fdisk /dev/sdx < /tmp/setboot.fdisk
>>> rm -f /tmp/setboot.fdisk
>>>
>>> K,
>>>
>>>
>>>   
>>>       
>>>> Spode
>>>>
>>>> Karl Lattimer wrote:
>>>>     
>>>>         
>>>>> On Tue, 2008-03-04 at 15:13 +0000, Andrew Miller (Spode) wrote:
>>>>>   
>>>>>       
>>>>>           
>>>>>> Hello,
>>>>>>
>>>>>> Bit stuck here, and hoping someone has the information stuck in their 
>>>>>> heads somewhere. Been Googling for a good hour.
>>>>>>
>>>>>> In a Linux script I'm writing, I need it to be able to set the boot flag 
>>>>>> on a partition. Which means no interactivity. I know how I could do this 
>>>>>> with parted, but the minimal distro I'm using doesn't have it standard. 
>>>>>> I have fdisk and mkfs.ext3.
>>>>>>
>>>>>> Any ideas?
>>>>>>     
>>>>>>         
>>>>>>             
>>>>> create an fdisk script
>>>>>
>>>>> ===== script file =====
>>>>> #!/bin/fdisk /dev/disk
>>>>> a
>>>>> 1
>>>>> =======================
>>>>>
>>>>> Or something to that effect.
>>>>>
>>>>> K,
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Kent mailing list
>>>>> Kent at mailman.lug.org.uk
>>>>> https://mailman.lug.org.uk/mailman/listinfo/kent
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>> _______________________________________________
>>>> Kent mailing list
>>>> Kent at mailman.lug.org.uk
>>>> https://mailman.lug.org.uk/mailman/listinfo/kent
>>>>     
>>>>         
>>> _______________________________________________
>>> Kent mailing list
>>> Kent at mailman.lug.org.uk
>>> https://mailman.lug.org.uk/mailman/listinfo/kent
>>>
>>>   
>>>       
>> _______________________________________________
>> Kent mailing list
>> Kent at mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/kent
>>     
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent
>
>   




More information about the Kent mailing list