Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.raspberry-pi > #10016

Re: DOS bootsector needed for NOOBS install?

From "Markus R. Kessler" <dimke.fax@uni.de>
Newsgroups comp.sys.raspberry-pi
Subject Re: DOS bootsector needed for NOOBS install?
Date 2015-11-23 10:14 +0000
Organization A noiseless patient Spider
Message-ID <n2uoug$en4$2@dont-email.me> (permalink)
References (1 earlier) <n2obho$vcd$1@dont-email.me> <zzT3y.411340$Ni7.54170@fx40.am4> <n2phhg$v4t$1@dont-email.me> <B954y.397670$eu4.165179@fx44.am4> <n2qq1u$jhq$1@dont-email.me>

Show all headers | View raw


Am Sat, 21 Nov 2015 22:09:02 +0000 schrieb Martin Gregorie:

> On Sat, 21 Nov 2015 21:15:13 +0000, Dom wrote:
> 
>> On 21/11/15 10:39, M.O.B. i L. wrote:
>>>
>>> How do you automate fdisk? Since I do this guide
>>> https://github.com/mobluse/coderdojo-raspbian-sv on many cards I would
>>> like to do it in a Bash-script or from Perl.
>> 
>> Possibly you could send the key sequences though a pipe into fdisk
>> using echo or cat. You could also use sfdisk, which can be fed a
>> complete new partition table in that way.
> 
> You could also use a HERE document, which works for any program that
> accepts commands, data, etc through stdin. Here's an example:
> 
> #!/bin/bash
> cat <<END
> line one
> line two
> END
> ls
> 
> This bash script first runs cat to list the two lines following itself
> and then lists the current directory. IOW the <<END says that the next
> line and all those following it are read by the program (cat) until a
> line containing the text following << is met.
> 
> For what you want, a script like:
> 
> #!/bin/bash
> sudo fdisk $1 <<END
> d
> 1
> d
> 2
> p
> w
> q
> END
> 
> should work  - sudo will prompt for the password and fdisk will read its
> commands and their arguments from the HERE document, thus deleting
> partitions 1 and 2, print a list of the remaining partitions (if any),
> write the modified partition table to the disk (SD card) and quit.
> 
> Create the script with an editor and remember to make it executable with
> the command:
> 
> chmod u+x scriptname
> 
> Then a command like "scriptname /dev/sda" will make fdisk make the
> requested changes to the requested SD card (/dev/sda is the built-in SD
> card reader, /dev/sdb etc would work on SD cards in external SD card
> readers, memory sticks or USB hard drives.

Hi,

this is slightly offtopic here, but worth to mention anyway:

When the ISO is written the first time, afterwards the installation /
setup process will boot from the SD card and then attempt to write the
MBR.

Once, during one of my experiments, I forgot to remove the Write
Protection on the Micro-SD to SD adapter, and, guess what?

The setup process continued, though the plastic switch was on "Lock". The
MBR got written corretly and Raspbian finally ran, no matter if the card
was set to RW or RO (!)

This, finally, means, that even a virus or trojan can write to "write-
protected" SD cards. Maybe this is a hardware issue only concerning this
adapter (I have no second one to test), but since it comes from "Intenso",
I assume that it is OK. That's somehow frustrating...

Best regards,

Markus

-- 
Please reply to group only.
For private email please use http://www.dipl-ing-kessler.de/email.htm



-- 
Please reply to group only.
For private email please use http://www.dipl-ing-kessler.de/email.htm

Back to comp.sys.raspberry-pi | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

DOS bootsector needed for NOOBS install? "Markus R. Kessler" <dimke.fax@uni.de> - 2015-11-19 22:12 +0000
  Re: DOS bootsector needed for NOOBS install? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-11-20 09:58 +0000
    Re: DOS bootsector needed for NOOBS install? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-11-20 10:10 +0000
      Re: DOS bootsector needed for NOOBS install? The Natural Philosopher <tnp@invalid.invalid> - 2015-11-20 10:15 +0000
        Re: DOS bootsector needed for NOOBS install? "Markus R. Kessler" <dimke.fax@uni.de> - 2015-11-20 14:04 +0000
  Re: DOS bootsector needed for NOOBS install? "M.O.B. i L." <mobil@orbin.se> - 2015-11-21 00:51 +0100
    Re: DOS bootsector needed for NOOBS install? Dom <domafp@blueyonder.co.uk> - 2015-11-21 05:47 +0000
      Re: DOS bootsector needed for NOOBS install? "M.O.B. i L." <mobil@orbin.se> - 2015-11-21 11:39 +0100
        Re: DOS bootsector needed for NOOBS install? Dom <domafp@blueyonder.co.uk> - 2015-11-21 21:15 +0000
          Re: DOS bootsector needed for NOOBS install? Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-21 22:09 +0000
            Re: DOS bootsector needed for NOOBS install? "Markus R. Kessler" <dimke.fax@uni.de> - 2015-11-23 10:14 +0000
            Re: DOS bootsector needed for NOOBS install? Dom <domafp@blueyonder.co.uk> - 2015-11-23 11:08 +0000
              Re: DOS bootsector needed for NOOBS install? "Markus R. Kessler" <dimke.fax@uni.de> - 2015-11-23 11:31 +0000

csiph-web