Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Setting bootable flag on partition non-interactively. (http://www.linux-archive.org/debian-user/318804-setting-bootable-flag-partition-non-interactively.html)

"Tim Legg" 02-01-2010 07:14 PM

Setting bootable flag on partition non-interactively.
 
Hello all,

Any suggestions on how to set a bootable flag non-interactively?



Reason:

I am creating a kiosk that restores itself from a saved image every time
the machine is booted. This system is very minimal; the partitions are
quite small. The image of the 2nd partition is stored as a file on a 3rd
partition.

I envision the machine completing these steps.
1. Boot from 1st partition.
2. Do housekeeping (i.e. run dd to restore a partition saved as a file on
a 3rd partition.)
3. Set 2nd partition as bootable, 1st partition as non-bootable.
4. Reboot, It boots from 2nd partition.
5. Set 1st partition as bootable, 2nd partition as non-bootable.
6. User operates kiosk using 2nd partition until it is shutdown.

This is actually a kiosk that keeps a partition image on a 3rd partition.
This image is restored to the 2nd partition. This ensures the system is
consistent every time the employee boots the computer.

Caveats:

* Is it damaging to toggle the bootable flag on a partition that is
currently mounted, or merely 'impolite' (i.e. bad practice)?


Tim Legg


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Stephen Powell 02-01-2010 11:54 PM

Setting bootable flag on partition non-interactively.
 
On Mon, 1 Feb 2010 15:14:55 -0500 (EST), Tim Legg wrote:
> Hello all,
> Any suggestions on how to set a bootable flag non-interactively?

sfdisk -A

See the man page for sfdisk for details.
For example,

sfdisk -A 1 /dev/hda

will mark the first partion on /dev/hda active and mark all other partitions inactive.
sfdisk is part of the util-linux package.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Eric Gerlach 02-02-2010 04:35 PM

Setting bootable flag on partition non-interactively.
 
On Mon, Feb 01, 2010 at 02:14:55PM -0600, Tim Legg wrote:
> Hello all,
>
> Any suggestions on how to set a bootable flag non-interactively?
>
>
>
> Reason:
>
> I am creating a kiosk that restores itself from a saved image every time
> the machine is booted.

A while ago I created a kiosk workstation that booted from PXE, downloaded its
root file system if newer (which was just squashfs, thus non-writable), and
then did a unionfs mount (I think these days you'd use aufs) to run.

It was a really elegant solution that worked well. Unfortunately, I don't have
those kiosks in operation anymore and their code is lost to the winds, but I
can try to give tips if you want to try to build one this way.

Cheers,

--
Eric Gerlach, Network Administrator
Federation of Students
University of Waterloo
p: (519) 888-4567 x36329
e: egerlach@feds.uwaterloo.ca


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


All times are GMT. The time now is 02:51 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.