<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 01.03.2018 um 17:31 schrieb Sven Dyroff <<a href="mailto:S.Dyroff@phytec.de" class="">S.Dyroff@phytec.de</a>>:</div><br class="Apple-interchange-newline"><div class=""><font size="2" face="sans-serif" class="">Hello Nikolaus,</font>
<br class="">
<br class=""><font size="2" face="sans-serif" class="">> Hm. Do you have a non-whitespace
white space? Happens sometimes when copying UTF charactersto a terminal.</font>
<br class="">
<br class=""><font size="2" face="sans-serif" class="">Ok, after typing the command by hand
I got the error that I have no rights to do that. So modified the command
once again:</font>
<br class="">
<br class=""><font size="2" face="sans-serif" class="">    DEV=/dev/sdg sudo ./makesd
qtmoko -r </font><a href="http://download.goldelico.com/letux-debian-rootfs/20180224-wheezy-7.11-armhf-qtmoko.tbz" class=""><font size="2" face="sans-serif" class="">http://download.goldelico.com/letux-debian-rootfs/20180224-wheezy-7.11-armhf-qtmoko.tbz</font></a>
<br class=""></div></blockquote><div><br class=""></div>Ah, ok. Well, it seems to protect the user :)</div><div><br class=""></div><div>I usually use an SD card reader of some SBC where I did ssh root access to so I never thought</div><div>about needing sudo.</div><div><br class=""></div><div>Maybe we should add a check that you really have write access to the specified device.</div><div><br class=""><blockquote type="cite" class=""><div class="">
<br class=""><font size="2" face="sans-serif" class="">Now it worked and created the SD card.</font>
<br class=""></div></blockquote><div><br class=""></div>Fine!</div><div><br class=""><blockquote type="cite" class=""><div class="">
<br class=""><font size="2" face="sans-serif" class="">But please note that in the end I got:</font>
<br class="">
<br class=""><font size="2" face="sans-serif" class="">-----------------------------------------%<----------------------------------</font>
<br class="">
<br class=""><font size="2" face="sans-serif" class="">rmdir: konnte '/media/P2' nicht entfernen:
Datei oder Verzeichnis nicht gefunden</font>
<br class=""><font size="2" face="sans-serif" class="">rmdir: konnte '/media/P3' nicht entfernen:
Datei oder Verzeichnis nicht gefunden</font>
<br class=""><font size="2" face="sans-serif" class="">rmdir: konnte '/media/P4' nicht entfernen:
Datei oder Verzeichnis nicht gefunden</font>
<br class=""><font size="2" face="sans-serif" class="">fsck von util-linux 2.27.1</font>
<br class=""><font size="2" face="sans-serif" class="">rootfs: 26693/7331840 Dateien (7.1%
nicht zusammenhängend), 650288/29305190 Blöcke</font>
<br class=""><font size="2" face="sans-serif" class="">fsck von util-linux 2.27.1</font>
<br class=""><font size="2" face="sans-serif" class="">fsck.ext2: Datei oder Verzeichnis nicht
gefunden beim Versuch, /dev/sdc2 zu öffnen</font>
<br class=""><font size="2" face="sans-serif" class="">Ist das Gerät möglicherweise nicht vorhanden?</font>
<br class=""><font size="2" face="sans-serif" class="">fsck von util-linux 2.27.1</font>
<br class=""><font size="2" face="sans-serif" class="">fsck.ext2: Datei oder Verzeichnis nicht
gefunden beim Versuch, /dev/sdc3 zu öffnen</font>
<br class=""><font size="2" face="sans-serif" class="">Ist das Gerät möglicherweise nicht vorhanden?</font>
<br class=""><font size="2" face="sans-serif" class="">fsck von util-linux 2.27.1</font>
<br class=""><font size="2" face="sans-serif" class="">fsck.ext2: Datei oder Verzeichnis nicht
gefunden beim Versuch, /dev/sdc4 zu öffnen</font>
<br class=""><font size="2" face="sans-serif" class="">Ist das Gerät möglicherweise nicht vorhanden?</font>
<br class="">
<br class=""><font size="2" face="sans-serif" class="">----------------------------------------->%----------------------------------</font>
<br class=""></div></blockquote><div><br class=""></div>That is a harmless and known bug. The script is not completely checking everything. So these warnings are not prevented.</div><div><br class=""><blockquote type="cite" class=""><div class="">
<br class=""><font size="2" face="sans-serif" class="">Accessing "/dev/sdc<x>"
is completely wrong and luckily I had no "/dev/sdc" that could
be erased! The same is true for "/media/P<x>"!</font>
<br class=""></div></blockquote><div><br class=""></div>Well, it is impossible to perfectly prevent erasing the wrong device, because only the user can know what the SD card reader with an SD really is.</div><div>So it is equally risky as calling fdisk directly.</div><div><br class=""></div><div>There is at least one protection: you can't overwrite /dev/sda.</div><div><br class=""></div><div>What you could do is to just sudo chmod o+rw /dev/your-sd-reader</div><div>but I am not sure what happens with newly created partitions.</div><div><br class=""><blockquote type="cite" class=""><div class="">
<br class=""><font size="2" face="sans-serif" class="">Furthermore: Why "fsck.ext2"?
My QtMoko v55 and v57 SD cards had already been formatted with "fsck.ext4".
So even "fsck.ext3" would have been outdated.</font>
<br class=""></div></blockquote><div><br class=""></div>No idea. The script only calls fsck.ext3. Seems to be a bug in util-linux 2.27.1 when printing the error message.</div><div>On my system, there are symlinks:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">root@letux:~# ls -l /sbin/fsck.ext*</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">lrwxrwxrwx 1 root root 6 Dec 31  2016 /sbin/fsck.ext2 -> e2fsck</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">lrwxrwxrwx 1 root root 6 Dec 31  2016 /sbin/fsck.ext3 -> e2fsck</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">lrwxrwxrwx 1 root root 6 Dec 31  2016 /sbin/fsck.ext4 -> e2fsck</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">lrwxrwxrwx 1 root root 6 Dec 31  2016 /sbin/fsck.ext4dev -> e2fsck</span></div><div style="margin: 0px; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">root@letux:~# </span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div><div>which means they are all the same independently of the ext2/3/4 suffix... One size fits all :)</div></div><div><br class=""></div><div>Anyways, this is just a safety check for a freshly created partition. So it should normally pass and</div><div>does not need to be perfect. It fails only if you have a broken SD card or SD card reader which</div><div>pretends to have written data...</div><div><br class=""></div><div>So I will prepare patches for both issues reported above. They will be available in some</div><div>days (after I have tested them).</div><div><br class=""></div><div>Thanks for feedback about makesd. It can only become better :)</div><div><br class=""></div><div>BR,</div><div>Nikolaus</div><div><br class=""></div></body></html>