Wednesday, August 5, 2020

Making an Image of a Disk (or Partition) Using dd WITHOUT Including Extra Empty Space

This write-up helped me a lot with this.

I have a Raspberry Pi that gets a lot of use as a media control station, and as a result, it periodically needs to be re-imaged. This is a lot faster and easier than re-installing everything from scratch and then setting up Mythtv, all my network settings, etc. So, a long time ago I used dd in Linux to make an image of a fresh install with all the basic things setup for my network, including Mythtv client. That install was on a microSD card that was 8 GB, so the resulting .img file was 8 GB even though at least half of that was unused. When I tried to write that image to a different 8 GB microSD card, it failed because of insufficient space. If one card had even one bit less (for reasons I do not know), it would be too small. What I needed was to get rid of all that empty space in the .img file.

Write the .img file to a larger memory card that will hold all 8 GB. Then use GParted to shrink the partition that has all the unused space in it to a reasonable size. Now, use sudo fdisk -l -u=sectors to find the number of the last sector used by the last partition.

Disk /dev/sdb: 7.4 GiB, 7960788992 bytes, 15548416 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00ed4

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sdb1         4096   147455   143360   70M  c W95 FAT32 (LBA)
/dev/sdb2       147456  6348892  6421187  7.4G 83 Linux
 

Make a new .img file from this memory card with the smaller partition. The key here is the parameter "count."

sudo dd if=/dev/mmcblk0 of=NO_WASTED_SPACE.img bs=512 count=6348892

where the count value is the number of the last sector of the last partition you saw in the fdisk listing. That makes dd stop reading anything after the last partition, namely all that extra empty space. Now you have an image file that is just the size you need, it won't take up extra storage space because of the unused space in the image, and when you write the image to a disk (memory card), you won't get errors and failure because the image is larger than the card you are trying to write it on.
 
Something important I learned, the sector size on the block device (memory card) shown via fdisk was 512. When telling it the sector to stop on, you have to make sure the input and output blocksize (bs=) is the same as the sector size, in this case 512. The first time I tried it, the image file was turning out to be huge because I use a block size of 4096 (bs=4096), but the number I used as the last sector to read (count=) was based on a sector size (block size) of 512. When I switched bs back to 512 (I believe the default), it worked fine. Now my image file is 3 GB instead of 8 GB, less space sitting on my hard disk drive, and it won't be picky writing to any device with 3 GB space or more.

Thursday, October 29, 2015

Print Enlarged Documents & Images with PDFPoster or PDFImages & Rasterbator.net

Two convenient methods of printing enlarged document or images follow:

1. PDFPoster is a command line utility for linux that will enlarge an input PDF document so that you can print it out on many sheets of paper.

2. PDFImages is a command line utility for linux that extracts the images from a PDF document. Then, you can use that image at http://Rasterbator.net, which will configure the image for printing an enlarged version on many sheets of paper. Pretty slick.

Tuesday, August 4, 2015

Nicholson bench... more progress


Today, I had to redo the top braces that go horizontally between the tops of each end/leg assembly because I mistakenly made them the wrong dimensions (1/4" short) based on the original design before we made a few minor modifications (changing it to be a split-top bench).

After doing that, I milled the "under-aprons" which beef up the thickness of both aprons. Each got planed on the face that was crowning, then straight-lined and ripped. I clamped one apron in place onto the legs and marked the under-apron to fit between the legs.

Next, we glued up each of the two under-aprons to its corresponding apron using PVA glue (Titebond original). We had to work fast. I spread the glue onto the planed side of the under-apron, flipped it into place, put two clamps on, adjusted it to be flush on what will be the top edge, & drove two screws in to hold the alignment. Then I repeated the process on the other pair.

After gluing and screwing both sets, we stacked them up and began putting clamps on. While that was setting up, I glued and screwed the new top braces into the leg assemblies with Little Brown glue.

Next will be getting the top pieces planed, ripped, and cut to length, then glued up to their "under-top" pieces like I did with the under-aprons.

Clamping apron to legs to check fit and to use for marking under-aprons

Clamping apron to legs to check fit and to use for marking under-aprons
Clamping glued aprons and under-aprons
Leg assemblies with top brace installed

Thursday, July 30, 2015

Nicholson Bench Leg Assembly

We did last-minute tune-up work on the legs today, like cleaning up the notches in the legs where the lower cross braces attach. I had to power plane the cross braces a bit more to make them fit flush, and one of the leg ledges where the apron sits required a little chisel work to trim a little more. Then we "sized the joint" by smearing some glue (in this case, warmed hide glue... specifically Little Brown Glue) on the joints and letting it sit for several minutes. This helps to seal the areas of end grain so they won't absorb all the glue and "starve" the joint. After it partially dried, we applied additional glue to all those surfaces, then assembled and clamped the parts. In this case, screws were added where called for.

I also finished drilling the 19 dog holes in the remaining apron. We made good progress today.




Thursday, July 23, 2015

New Work Apron

When I began woodworking, the only apron I had was one from the kitchen. It wasn't the greatest kitchen apron, but it certainly wasn't well-suited for the shop. It was better than nothing... barely, so that's what I've been wearing. By far, my biggest complaint is the strap that goes around my neck to hold the apron up. I can't stand the feeling of a strap pulling on the back of my neck all the time. It's a serious distraction and drives me nuts. The kitchen apron also lacked appropriate pockets and strength for a shop apron.

I've seen handmade shop aprons from a maker in Texas that seem well made with waxed (or non-waxed) canvas, leather straps that cross in the back and do not go around the neck, and custom sized pockets to fit the phone and other utensils that the wearer wants to always have at hand. The price of these aprons reflected their quality and kept me from joining in on the quality apron fun... until I proposed a joint project with my wife.

She bought some canvas at a discount fabric store, and we bought some leather (buffalo) straps, a leather hole punch, slides, D-rings, copper rivets, and a rivet set thingy.

After discovering that her machine would not work with a double needle (which would've made the double stitching easier and more precise), she resolved to do the work with a single needle. She laid out the apron according to my body and how I wanted it to fit and proceeded to sew the edges and the pockets.

Upon completion of the sewing, I cut the leather to length, installed the slides for adjustability, put the D-rings in the appropriate places, and attached the leather with copper rivets. The apron is wearable now, but I plan to put copper rivets at all pocket corners and stress points for durability. They're (rivets) surprisingly easy to install. The apron that inspired mine has a separate strap that goes horizontally from one side of the apron to the other with a clip. It's a butt strap. I'm not certain I will put this on mine because, so far, it seems superfluous.

Oh, I almost forgot to mention... I also got a bar of paraffin wax and rubbed it across the outside of the canvas, then melted it into the fabric with my heat gun (it's good for something besides reflowing solder on my PS3). Not only does the wax make the apron water, dirt, & glue resistant, it also gives it a "broken in" look that I like.
Added the slides for adjusting the shoulder straps

Shoulder straps riveted to slides

Punching holes in the leather straps (the ones that hold the D-rings on the top of the apron)

Setting the copper rivets
Setting the copper rivets

Cutting excess rivet shank

Finished rivets after blunting the cut shank with the rivet tool

Comfy, durable, & STYLISH apron ready to catch some wood shavings and dust

Tuesday, July 21, 2015

Design modifications, legs, hardware

Since my last post, we've made some modifications to the design in SketchUp such as increasing the height. We're also going to use "two-by" material for the apron backer instead of "one-by." The bench will now be a split-top with 2" between the two top boards, necessitating eight cap screw holes in the top instead of six (two on each end of each top board).

The glue on the legs was given too much time to dry before cleaning up, so the messy edges were shaved on the rip saw. I used a stacked dado set on the table saw to make the notches in the legs for the lower cross braces. I cut and milled the upper ends, lower cross braces, and top leg braces to size.

I have acquired the cap screws, washers, and nut plates, and I've also purchased four Gramercy Holdfasts.

The legs need to be assembled next. I have dog holes drilled in one apron, but many holes are left to drill in the other apron and the two top boards.






Sunday, July 5, 2015

Building My Knockdown Nicholson Workbench

My first workbench will be a variation of the Nicholson bench that can easily be disassembled and stored flat if necessary. I'm using the plans from Lost Art Press. You can read and see more about this bench here.

I've chosen to use fir from my local home center... Seven 2x12x16s. So far, I've identified which boards will be used for what pieces (based on characteristics of the wood like checks and knots that will have structural and/or visual implications), rough cut, milled and glued up the legs, and begun drilling the dog holes in the front and back aprons.

Legs glued up:
 

An apron getting dog holes drilled: