PiShrink on Windows 10 Tutorial / Guide (RetroPi SD Card Issues Fixed!)
Ғылым және технология
The new improved 2020 way of using this awesome little script to save yourself some money when an .IMG file is too big to fit on the SD Card that you have.
Don't buy a bigger card! Make a smaller image!
This works for any .IMG file for any device you need to write/flash it to so this tutorial is good for so much more than just RetroPi and Micro SD Cards!
Before you can use the information in this video, please first get WSL2 installed and working on your machine following this guide:
• How To Run Linux on Wi...
Hope you found this video helpful.
Пікірлер: 74
Hey! I'm the author of PiShrink. Thanks for making a great tutorial on how to use it with WSL
@davids629
Жыл бұрын
Thank you!
@Phillyrider807
Жыл бұрын
thank you!
Finally. FINALLY! I found the one tutorial that lets me shrink those damn images on my pc, without jumping through the craziest of hoops...! Thank you so much for this!
Great video, thanks. Had some trouble getting wsl to use version 2 - finally found I had to enable virtualization in the BIOS startup menu and then it worked.
@enrique7934
3 жыл бұрын
Yup, same. Thanks!
@hieroben
2 жыл бұрын
In my case, virtualization was already enabled but still no wsl 2. I had to download an update package for the linux kernel from microsoft to make it work. Try "wsl --set-version Ubuntu 2" and wsl will tell you if there is any problem.
thanks dude, seems like you got the best solution on the internet for this one, took me a while before I got here...
Very clear instructions and easy to follow. Perfect tutorial thanks dude!
Thank you so much for this simple but informative tutorial
thank you for the great video, exactly what I was looking for. Microsoft has now made WSL install super simple with a single command line wsl --install and then reboot, all done
Thanks for this. So many tutorials for the virtual box and etc are outdated and many of them don't work the way people instruct you to do it. If you run into issues--there are no guides how to fix those issues easily. Just wasted time. This method took me less than 15 min to get up and running and about 10 minutes to get it done.
Thanks for the video! Probably a good idea to run "sudo apt update" and "sudo apt upgrade" before you run the scriopt. Don't forget to put "sudo" in front of the command to run the script to run as root. Also, definitely double-check in your BIOS if virtualization is enabled, like he suggests. I didn't because my motherboard documentation says it's enabled by default, but then I couldn't get WLS to run as Version 2. I finally checked in the BIOS settings, and it wasn't enabled. In my BIOS, the setting was under Advanced>CPU.
amazing video. I'm building a custom arcade cabinet and building all custom layout intro videos. One think i needed was this to make my life 100% simpler. Also easier to make sd card backups using "dd"
i dit it, thank you so much, very clear tutorial with details of explanation. And your extra video of WSL v2 on windows is cool, too. Now i'm not only can shrink some of my pi image, but also can do a lot of stuff with the Sub-system Linux on my windows. 1 sub 1 like, thanks again.
Works like a charm! Thank you very much.
You saved my day. Thank you. And of course subscribed!
AWESOME - I fought with other TUT. I had this one up and runnign is less than an hour, AND, I kind of understand what I did. ALSO my 32gig is now 5 gig THANK YOU THANK YOU THANK YOU
@ViciousXUSMC
3 жыл бұрын
Your welcome!
Amazing! Thanks a lot this was very very helpful :)
awesome tutorial just followed it and it works fine with win 11 also, thanks helped me a lot
Still works in 2023 (i did have to use sudo first for it to work though) Thanks for this. Was able to shrink a steam deck image.
If only this was available sooner, about a year ago I had this problem and took me like 10 hours to solve, mostly because the people in the tutorials forgot to mention that you need to enable "virtualization" from Bios and the steps needed to share folders between your PC and virtual machine, so I had to guess those things. (Coming from someone who never used virtual box or any Linux OS)
Youre a life saver brother. Thank you.
Can you please tell me which folder to drag and drop pi shrink into through the network back door? You glazed over both drag and drop options and I can't get it to work the way you are showing in comand promt. Thanks.
HELP. I’ve made it to the very last step but it’s saying my .img is not a file. I have it save on the same drive as the pishrink wether or not that matters
if you get a semaphore error, make sure to upgrade to wsl version 2 if you missed that step. @Vicious Computers. I tried doing virtual machines and had all kinds of problems. I have slow internet. This is the only feasible way to quickly get this done. Thank you.
what i needed .. thank you
Thanks man!!!! I was able to take an .img that was 224GB and bring it down to 40GB
Worked great. I had to specify that path to pishrink in /usr/local/bin before it would recognize the command. I would like to be able to use it without specifying the path. pishrink shrunk several 30GB images I had to 5GB. I just need to actually try them to see if they work.
Can you please explain if you can drop the pishrink.sh file into a folder to make this work, after opening it up through the explorer window showing the roots? You were about to mention it then you said you preferred using the ubunto command prompt.
Thanks a million for this!
Ahh... @Marcel got it working when using the 'Ubuntu' image from the Microsoft Store instead of the 'Debian' image that I had installed at first.
The best one. thanks a ton
After the Orange Pi installation steps are all executed successfully, I shut down and restart and cannot connect to the Orange Pi. I need help.
Hi, Trying to run pishrink on Windows 10 with WSL Ubuntu 20.04 and I get the following error: "Kernel not configured for semaphores (System V IPC). Not using udev synchronisation code." Couldn't find anything in google that would help (tried adding symlink :sudo ln -s /proc/self/mounts /etc/mtab). Any ideas what can go wrong?
@bossrobotgames
3 жыл бұрын
I had the same problem and used this website to put together the missing pieces. news.timekills.info/pishrink-using-windows-10-windows-subsystem-for-linux-2-wsl-2/ I had to go to two other sites referenced in the link above. My problem was I didn't have WSL2 as a default. I ran this command and saw wsl version was set to 1 wsl -l -v Then this website showed me how to set it to WSL2 www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10 using this command wsl.exe --set-version Ubuntu-20.04 2 (you need to specify which version of ubuntu) After that the command to run pishrink needs to have sudo in front so it looks like this: sudo ./pishrink.sh [name of file].img I think the file also has to be in the same directory as pishrink.
trying to do this but its not showing my usb D drive where my img is.anyway to see it?
That's very interesting, however I got the following error when running pishrink: tune2fs: Bas magic number in super-block whilte trying to open /dev/loop0; and then tune2fs failed. Unable to shrink this type of image. Any help? Thanks!
Unfortunately, it seems like a lot of the 32gig images out there are already shrunk as much as they can be. It shrunk from 30gig to 30gig, but my cheap MicroCenter card is 29.11gig. I spent a lot of time getting to the final step only to find that out. Just going to buy a Sandisk or Samsung card next time. :)
Works perfect, in my case after log in root mode, the command thats work for me was $sudo pishrink.sh and the file was resized in windows
can it shrink other SBC's images like debian os?
Good video. I couldn't get it to work completely. I think it needs to be windows 10 Pro. If someone knows otherwise, I'd be happy to learn what I did wrong.
So when I do this, it needs to tell me I “need to run as the root” when attempting to shrink the .img file located in the pishrink folder. Placing on the root says no file exists
@ViciousXUSMC
2 жыл бұрын
In Linux root means as admin. Try using sudo as part of your command.
@retrolizardscustomarcades
2 жыл бұрын
@@ViciousXUSMC thank you sir. That worked. This video was extremely helpful.
Thank you for this video and the predecessor one. I followed your directions, but received this error when I finally got to the point of running the pishrink script: pishrink.sh v0.1.2 pishrink.sh: ERROR occurred in line 220: You need to be running as root. Any suggestion of how to cure this error? Thanks again!
@ViciousXUSMC
3 жыл бұрын
running as root? thats pretty much saying you need super user (admin) rights. Not sure why you have that error.
@rodrigomolinadacaret8108
3 жыл бұрын
just use "sudo" before the pishrink command
@CoronadosBrickHouse
3 жыл бұрын
@@rodrigomolinadacaret8108 I had the same issue. just activating root permisions before as you suggested solved my issue.
Thank You.
Hello, could you pls help me promote a memory card?
did all this to find out the image i was using was already shrunk smh its a 58.3 GB image and my SD card only has 58.2GB available. I'm Just gonna KMS
Skip ahead to 05:30 to get to what the title of this video is about...
I followed all the steps and got this: "ERROR occurred in line 220: You need to be running as root." please help!
@drewjbx228
3 жыл бұрын
got the same thing, did you figure this out?
@ryansretrogamingchannel7494
3 жыл бұрын
@@drewjbx228 No I gave up. Ended up spending the extra money and buying name brand micro SD cards that will fit the entire image. The cheaper ones unfortunately do not have the entire space!
@bobkirkpatrick4638
3 жыл бұрын
@@drewjbx228 put sudo in front of the pishrink command sudo ./pishrink.sh ..... I just now got done with a img that was 125 gig and is now 109 will fit my 128 card easy now.
@foli12321
3 жыл бұрын
Try the command "sudo -i" before running the script. That worked for me and let me run as root.
Also fails at my end - in the same way as @Marcel described...
still no super easy way to do this on mac yet 😔
looks you have the best thing out there - yet if its more complicated than the sd card copy built into rasperry pi - then this will not have wide appeal - sorry
ERROR occurred in line 223: You need to be running as root.
got to last step and saying error occud in line 220: you need to be running as root HELP
@roninjei
3 жыл бұрын
use "sudo" before the command: sudo ./pishrink.sh file.img
@bencolmer5343
3 жыл бұрын
@@roninjei thank you!!!
Don't forget to make pishrink.sh executable (chmod +x pishrink.sh) Also I used Debian and phshrink.sh failed due to parted not installed. Had to first 'sudo apt-get update' then 'sudo apt-get install parted' (would not install without the first step)