{"id":389,"date":"2010-03-12T15:02:12","date_gmt":"2010-03-12T15:02:12","guid":{"rendered":"http:\/\/brej.org\/blog\/?p=389"},"modified":"2010-03-12T15:02:12","modified_gmt":"2010-03-12T15:02:12","slug":"fedora-on-usb-sticks","status":"publish","type":"post","link":"https:\/\/brej.org\/blog\/?p=389","title":{"rendered":"Fedora on USB sticks"},"content":{"rendered":"<p>I ordered some USB sticks to give away to the better students to encourage them to contribute to open source software. The idea is that they can run their own installation where they can install development libraries etc. I&#8217;ll write more about this in a few weeks when I know how successful this has been.<\/p>\n<p><a href=\"http:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/sticks.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-390\" title=\"sticks\" src=\"http:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/sticks-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/sticks-300x225.jpg 300w, https:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/sticks-1024x768.jpg 1024w, https:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/sticks.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Installing <a href=\"http:\/\/fedoraproject.org\/\">Fedora<\/a> on the disks is relatively easy. Nowadays I install computers using a USB drive, by simply DDing the iso directly to the device.<\/p>\n<pre>dd if=Fedora-12-i686-Live.iso of=\/dev\/sdb<\/pre>\n<p>The target USB stick will look just like any other hard drive. You just have to make sure you install the bootloader onto the target stick by overriding the BIOS boot order in the grub installation screen.<\/p>\n<p>Once installed, I didn&#8217;t want to actually boot the device as I wanted the students to go through the first boot process of setting up a their own user. But I wanted to install some development packages and do a full system update. This can be done by mounting the device, chrooting and running yum commands. The live image has a \/mnt\/sysimage which is already set up to do something like this by already having \/proc and \/dev correctly set up.<\/p>\n<pre>mount \/dev\/sdb1 \/mnt\/sysimage\r\nchroot \/mnt\/sysimage<\/pre>\n<p>The biggest issue with running from USB sticks is that they have no on device cache, thus each fsync command takes absolutely ages. Yum, correctly, makes heavy use of fsync to make sure it leaves the system in a sensible state even if interrupted. To speed things up I tried <a href=\"http:\/\/www.flamingspork.com\/projects\/libeatmydata\/\">libeatmydata<\/a>, which worked surprisingly well. I updated the installation several times faster. LibEatMyData is named thusly because of it&#8217;s real ability to screw things up royally, but in this situation if anything went wrong, I could just restart. Maybe some yum devels could mention if this is outright dangerous, or a fairly safe trick if you can guarantee no interruptions.<\/p>\n<p>Of cause at this point I only have one stick installed, and making six this way is out down right boring. So long as the other disks are the same size (or larger), you can clone the disks from one to another. You need a bit of storage space so best to do this from another machine.<\/p>\n<pre>dd if=\/dev\/sdb of=master_image\r\ndd if=master_image if=\/dev\/sdc\r\ndd if=master_image if=\/dev\/sdd\r\ndd if=master_image if=\/dev\/sde\r\n...<\/pre>\n<p>Watch out though if you use this method, all the partitions will gain the same UUID, which will confuse the system when more than one is plugged into a single machine.<\/p>\n<p>The postage costs are annoying so I went with play.com, who offer free postage (which is nice). What was ridiculous is that they post each item in a separate box which is way too big. For a tiny piece of plastic, there is a Kingston presentation box, each placed in its own massive cardboard box and posted separately. I hear this is because they have some kind of tax loophole where parcels of value below some threshold are not taxed.<\/p>\n<p><a href=\"http:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/packaging.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-391\" title=\"packaging\" src=\"http:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/packaging-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/packaging-300x225.jpg 300w, https:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/packaging-1024x768.jpg 1024w, https:\/\/brej.org\/blog\/wp-content\/uploads\/2010\/03\/packaging.jpg 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The entire CS department has be refitted with awful Dell machines which have some screwy USB chipsets which allow booting off a memory stick only from the back ports on some manufacturers. I did something really stupid by accidentally mentioning to duty-office that it was possible to boot the departmental machines off a USB device. Now they are now going to go through and disable this feature (Grrr).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ordered some USB sticks to give away to the better students to encourage them to contribute to open source software. The idea is that they can run their own installation where they can install development libraries etc. I&#8217;ll write more about this in a few weeks when I know how successful this has been. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,9,10],"tags":[],"_links":{"self":[{"href":"https:\/\/brej.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/389"}],"collection":[{"href":"https:\/\/brej.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brej.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brej.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brej.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=389"}],"version-history":[{"count":4,"href":"https:\/\/brej.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":395,"href":"https:\/\/brej.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/389\/revisions\/395"}],"wp:attachment":[{"href":"https:\/\/brej.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brej.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brej.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}