{"id":2930,"date":"2022-09-02T20:01:41","date_gmt":"2022-09-02T20:01:41","guid":{"rendered":"https:\/\/liljenfeldt.ch\/?p=2930"},"modified":"2022-09-02T20:01:41","modified_gmt":"2022-09-02T20:01:41","slug":"raspberry-pi-4-with-os-on-big-2-tb-drives","status":"publish","type":"post","link":"https:\/\/webbservern.se\/~jonas\/wordpress\/?p=2930","title":{"rendered":"Raspberry Pi 4 with OS on big (>2 TB) drives"},"content":{"rendered":"\n<p>I recently switched to Ubuntu 22.04 on my Raspberry Pi 4 and faced an issue with trying to use the full space on my RAID cabinet (Icy Box&nbsp;IB-RD3640SU3E2). The parition table type MBR is no good for such cases and that is what one gets after writing the installer on the USB drive with rpi-imager. What to do?<\/p>\n\n\n\n<p>Fortunately there is a convenient tool called mbr2gpt (don&#8217;t bother with gparted, it failed me at least) which does the conversion in-place without data loss (at least the two times I have used it&#8230;).<\/p>\n\n\n\n<p>The process for a fresh Ubuntu 22.04 installation on an external USB connected drive (for example a RAID cabinet as outlined above).<\/p>\n\n\n\n<p>1. Use rpi-imager to write <a href=\"https:\/\/cdimage.ubuntu.com\/releases\/22.04\/release\/ubuntu-22.04.1-preinstalled-desktop-arm64+raspi.img.xz\">Ubuntu 22.04 preinstalled image<\/a> to the usb drive and to a SD card<br>2. Boot with the USB drive plugged in and go through the Ubuntu installation guide<br>3. Boot with the SD card plugged in and without USB drive and go through the Ubuntu installation guide.<br>4. Boot with the SD card but without USB drive, then plug in the USB drive when Ubuntu has started. Unmount the USB drive if it is mounted.<br>5. Use the <a href=\"https:\/\/forums.raspberrypi.com\/download\/file.php?id=53229&amp;sid=3bb989ae38e4eff769cb01bbc587652a\">mbr2gpt<\/a> utility to convert mbr to gpt and expand the root partition (sudo mbr2gpt \/dev\/sda). Choose to expand the root filesystem and not to boot from SD card.<br>6. Reboot without the SD card.<\/p>\n\n\n\n<p>If you have to also restore a previous backup (for example a simple tar archive done with <code>tar cvf \/backup.tar --exclude=\/backup.tar --exclude=\/dev --exclude=\/mnt --exclude=\/proc --exclude=\/sys --exclude=\/tmp --exclude=\/media --exclude=\/lost+found \\ \/<\/code>), like in my case, this would be the additional steps:<\/p>\n\n\n\n<p>7. Start with the SD card and without USB drive.<br>8. Mount the USB filesystem on \/media\/new and create \/media\/backup<br>9. Mount the filesystem with backup file: mount -t nfs serve:\/media\/backupdir \/media\/backup<br>10. Make a backup of \/media\/new\/etc\/fstab and \/media\/new\/boot\/firmware\/cmdline.txt<br>11. Copy the backup to USB drive&#8217;s filesystem: tar xvf \/media\/backupdir\/backup-file.tar -C \/media\/new<br>12. If you refer to PARTUUIDs in fstab or cmdline.txt, restore to match the partition UUID from the backup<br>13. Reboot without the SD card and hopefully the system boots fine (like it did for me&#8230;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently switched to Ubuntu 22.04 on my Raspberry Pi 4 and faced an issue with trying to use the full space on my RAID cabinet (Icy Box&nbsp;IB-RD3640SU3E2). The parition table type MBR is no good for such cases and &hellip; <a href=\"https:\/\/webbservern.se\/~jonas\/wordpress\/?p=2930\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,11,16,36],"tags":[815,72,816,817,819,818,612],"class_list":["post-2930","post","type-post","status-publish","format-standard","hentry","category-datorer","category-hardvara","category-linux","category-webbservern","tag-22-04","tag-backup","tag-gpt","tag-mbr","tag-mbr2gpt","tag-restore","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2930"}],"version-history":[{"count":2,"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2930\/revisions"}],"predecessor-version":[{"id":2932,"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2930\/revisions\/2932"}],"wp:attachment":[{"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2930"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2930"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webbservern.se\/~jonas\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}