一般的に使われている方はあまり問題が出ないのかもしれませんが、私の利用方法ではよく同一パーツを20個くらい並べて出力するケースが多く、その場合1個の時点のSTLの容量は3MBくらいでも気が付くと500MB~とか言ったケースがよく見られます。
SQ1のデフォルトで挿入されているSDカードを確認するとなんとSundiskのIndustrialグレード8GBでした。1枚での販売は見つからなかったのですが5枚で22000とかなりの高額SDが刺さっていました
さすがにIndustrialグレードはお財布的に厳しいのでRaspberryPi3用によく利用するMicroSDを選定、
1/5くらいの値段ですが、壊れたら焼き直せばいいだけと割り切れば問題ないですね。
まずファームウェアの導入
通常RaspberryPiのSDの移行には、Win32DiskImagerを使うことが多いのですが、うちの環境ではなぜか起動せず、たまに起動するけど使おうとすると起動せず。再インストールしても何してもダメだったのですが、やってくれましたよTrendmicroさん。ヤツの常駐切ったら動き出しました。
起動してくれればこっちのもので、メーカーのリカバリイメージをWriteしてサクッと差し替え
今回はゴミデータをクリアする意味もかねてメーカー提供のImageに戻しちゃいました。

これだけでは、容量は増えません。ここからが勝負です。
DFコマンドを使ってパーティションの拡張
pi@raspberrypi:~ $ sudo fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
pコマンドで現在の状態を確認
Command (m for help): p
Disk /dev/mmcblk0: 59 GiB, 63383273472 bytes, 123795456 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: 0xea0e7380
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 131071 122880 60M c W95 FAT32 (LBA)
/dev/mmcblk0p2 131072 7684095 7553024 3.6G 83 Linux
dコマンドで隠し部分のパーティションを削除。
Command (m for help): d
2番目のパーティションが対象なので2を選択する。
Partition number (1,2, default 2): 2
Partition 2 has been deleted.
pコマンドで今の状態を確認。
Command (m for help): p
Disk /dev/mmcblk0: 59 GiB, 63383273472 bytes, 123795456 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: 0xea0e7380
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 131071 122880 60M c W95 FAT32 (LBA)
nコマンドで新規パーティションを作成
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
p(primary)を選択
Select (default p): p
2番目のパーティションを選択
Partition number (2-4, default 2): 2
最初のpコマンドで表示されていた2番目のパーティションのstartの値を入力(今回の場合は131072)
First sector (2048-123795455, default 2048): 131072
何も入力せずにエンター
Last sector, +sectors or +size{K,M,G,T,P} (131072-62453759 , default 62453759):
pコマンドでパーティションの領域が大きくなっていることを確認する。
Disk /dev/mmcblk0: 29.8 GiB, 31976325120 bytes, 62453760 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: 0xe6a544c8
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 131071 122880 60M c W95 FAT32 (LBA)
/dev/mmcblk0p2 131072 62453759 62322688 29.7G 83 Linux
wコマンドで書き込み。(書き込むと元には戻れません)
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
再起動する。SQ-1の場合電源ブチ切りでも問題ないのかもしれないけど
不安なのでコマンドラインから再起動
pi@raspberrypi:~ $ sudo reboot
ひとまずDFで確認。パーティションは広がっても空き容量は増えないんです
pi@raspberrypi:~ $ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 3657472 1149128 2331300 34% /
devtmpfs 437228 0 437228 0% /dev
tmpfs 441548 0 441548 0% /dev/shm
tmpfs 441548 5908 435640 2% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 441548 0 441548 0% /sys/fs/cgroup
/dev/mmcblk0p1 61384 20384 41000 34% /boot
次にresize2fsコマンドで領域をリサイズ
ここで気づいたこと・・・もとの容量もおかしくない?w
pi@raspberrypi:~ $ sudo resize2fs /dev/mmcblk0p2resize2fs 1.42.12 (29-Aug-2014)Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing requiredold_desc_blocks = 1, new_desc_blocks = 4The filesystem on /dev/mmcblk0p2 is now 15458048 (4k) blocks long.
ふたたびdf 使用済み容量は34%から4%に
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 30656252 1150068 28234756 4% /
devtmpfs 437228 0 437228 0% /dev
tmpfs 441548 0 441548 0% /dev/shm
tmpfs 441548 5912 435636 2% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 441548 0 441548 0% /sys/fs/cgroup
/dev/mmcblk0p1 61384 20384 41000 34% /boot
ちゃんと30Gとして認識されました!
これでまじめに生産に入れます。
楽しい3Dプリンタライフを!
※改造するとメーカーのサポート等は受けられなくなる恐れがあります
ご利用は計画的に

コメント
SQ1 SD card died do u happen to have a backup>?