If you’ve done the SD card mod on WRT54GL, you might at some point change it with a bigger / faster card. You could just replace the SD card with a bigger one, but then you’d have to install/re-configure everything set up on it (like Optware stuff).
Assuming you don’t have 2 separate card readers to make the data copy on-the-fly, you’ll need to image the old card and then write the image to the new card. First turn off the router and unplug the card. Then plug it into the card reader. I recommend using PartedMagic or SystemRescueCD. They are live Linux systems which can run from a CD / usb stick.
To create the image of the old card:
dd if=/dev/sdb of=/storage/router_card_image.dd bs=1M
- sdb is the drive designation given to your card (check with fdisk -l to identify the connected devices, like hard disks / usb sticks); make sure you indentify the card correctly
- /storage/ is some disk/usb stick with enough space to hold the whole SD image (for a 4GB SD card, 4GB of space is needed)
To monitor the progress, use killall -USR1 dd in a separate terminal.
Once the image is created, remove the old card and insert the new card in the card reader.
Again, use fdisk -l to list the connected devices / partitions and correctly identify the SD card
dd if=/storage/router_card_image.dd of=/dev/sdb bs=1M
- sdb is the drive designation given to your card; you really need to make sure this is correct; you will lose data if you use the wrong device
- /storage/router_card_image.dd is the image file created earlier.
Once the write is complete, use gparted to resize the partition. Both PartedMagic and SystemRescueCD have it.
One issue I’ve encountered here is that gparted wouldn’t resize the filesystem, just the partition on one of the 8GB card I used. The resize ran fine with a 4GB card.
Running resize2fs on the partition manually would always return this message
e2fsck -f /dev/sdb1 first.
even if I previously ran e2fsck.
So I used
resize2fs -f -p /dev/sdb1
where -f means ‘force‘ and -p means ‘display progress‘. This will ignore the check and resize the filesystem forcefully. Make sure you have manually run e2fsck -f on the partition beforehand.
The resize will take a while (for the 8GB class 10 card it took me 10 minutes).
PS: I tested various cards on the WRT54GL v1.1 and discovered some work and some don’t:
- 2GB SD medium speed (probably class 6) noname works fine
- 4GB SDHC class 4 Verbatim works fine
- 8GB SDHC class 10 ADATA fails (router boots fine but fails to see card)
- 16GB SDHC class 10 ADATA fails (router locks up with WPS led continuously blinking; the filesystem on the card was damaged by the router)
- 16GB SDHC class 10 Kingmax fails (router locks up with WPS led continuously blinking; the filesystem on the card was damaged by the router)
I don’t know if the limitation is size or speed related.