I have a Raspberry Pi with the default, store-bought operating systems on it. I want to wipe the SD card clean so that I can put in a new operating system, but I want to preserve the original OS in a backup disc image. I planned to store it in a .bin file. The SD card has two partitions.
I used the following command to figure out which drive is the SD card.
sudo dmesg | tail
--output--
[ 2954.642182] sd 3:0:0:0: [sdb] Attached SCSI removable disk _
[ 2955.149750] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
I believe this tells me that it is under dev/sdb2, but I also tried dev/sdb, ~/dev/sdb and ~/dev/sdb2. I used the following command to create the image:
dd if="dev/sdb2" of="~/Desktop/Pi Backup/Pi.bin"
But when I try to do this it returns the error message
dd: opening `dev/sdb2': No such file or directory
I'm running Linux Mint, Cinnamon.
Any help is appreciated.
Instead of doing:
sudo dd if="/dev/mmcblk0p1" of="Pi_1.bin"
sudo dd if="/dev/mmcblk0p2" of="Pi_2.bin"
try:
sudo dd if="/dev/mmcblk0" of="Pi.bin"
p1 and p2 are the partitions in that device and you want to make an image of the entire device.
All devices are under /dev
dev is looking for dev under the current directory and ~/dev is looking for dev under your home directory.
/dev/sdb2 if the second partition, I would expect use have /dev/sdb1 (the first partition) too.
sudo dmesg | tail -30
will give you the last 30 lines, then you should be able to see the sdb1 too.
I'm on Mint 14 and I did mount and the SDcard shows as 2 partitions like below
/dev/mmcblk0p1 on /media/nig/3312-932F type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
/dev/mmcblk0p2 on /media/nig/b7b5ddff-ddb4-48dd-84d2-dd47bf00564a type ext4 (rw,nosuid,nodev,uhelper=udisks2)
so I then did
sudo dd if="/dev/mmcblk0p1" of="Pi_1.bin"
sudo dd if="/dev/mmcblk0p2" of="Pi_2.bin"
seemed to work, not sure about restoring, not tried that yet
Related
I am trying to use the 64 bit version of raspbian (which can be found here: https://www.raspberrypi.org/forums/viewtopic.php?f=117&t=275370
I downloaded it, installed everything, ran my updates and then switched on the camera. But when I try to run it, the PI just gives back
bash: /opt/vc/bin/raspistill: No such file or directory
When I do a ls, I can see the directory fine:
pi#raspberrypi:/opt/vc/bin $ ls
containers_check_frame_int containers_test dtoverlay-pre raspiyuv
containers_datagram_receiver containers_test_bits dtparam tvservice
containers_datagram_sender containers_test_uri edidparser vcdbg
containers_dump_pktfile containers_uri_pipe mmal_vc_diag vcgencmd
containers_rtp_decoder dtmerge raspistill vchiq_test
containers_stream_client dtoverlay raspivid vcmailbox
containers_stream_server dtoverlay-post raspividyuv vcsmem
and when I look at the permissions, there are read/execute permissions for everyone:
-rwxr-xr-x 1 root root 142397 Nov 1 16:25 raspistill
Im at a bit of a loss here - the file is right there, so why is it not being found when I try to call it from the command line?
Unfortunately, it looks like MMAL userland still (at the time of writing this) has some unresolved issues with 64bit raspberry pi OS, so it is disabled.
However, one can use docker or cherry-build 32bit packages as workarounds.
I am very new to yocto world, I am following below instructions to compile yocto.
http://doc.qt.io/QtForDeviceCreation/qtee-custom-embedded-linux-image.html
When I compiled yocto(boot2qt) from qt repository I got sdcard image. When I flashed sdcard to memory card I observed that there is no files in /boot/ directory kernel and dtb files are present in another partition mmc1p1. My u-boot configuration is as below
setenv bootargs 'console=ttymxc1,115200 root=/dev/mmcblk0p2 rootwait fixrtc rw'
setenv bootcmd 'mmc dev 1; ext2load mmc 1:2 10800000 /boot/zImage;ext2load mmc 1:2 0x12000000 /boot/imx6q-sabrelitesd.dtb; bootz 0x10800000 - 0x12000000'
saveenv
And its not booting because there is no files in /boot/ directory. Then I changed my uboot configuration as below
setenv bootcmd 'mmc dev 1; ext2load mmc 1:2 10800000 /zImage;ext2load mmc 1:2 0x12000000 /imx6q-sabrelitesd.dtb; bootz 0x10800000 - 0x12000000'
and I am getting file not found error, so its clear that I have mentioned
root=/dev/mmcblk0p2 and I am trying to load kernel from mmc0p1
How to fix this issue? Should I have to do something on yocto configuration and make kernel and dtb files to be available in /boot/ directory or I have to change u-boot configuration to load kernel from different partition and rootfs from different partition?
The problem here is you are still trying to load kernel and dtb from partition 2, you have to update bootcmd. And as per my knowledge with yocto partition1 will be in FAT file system so you have to use fatload.
setenv bootcmd 'mmc dev 1; fatload mmc 1:1 10800000 /zImage; fatload mmc 1:1 0x12000000 /imx6q-sabrelitesd.dtb; bootz 0x10800000 - 0x12000000'
I believe you are using .SDCARD image from yocto. So then follow the below command to flash your image to sdcard. First delete all your sdcard partitions and umount the sdcard. then use lsblk command to know the /dev/sdb|c|d or mmcblk0 etc
sudo dd if=fsl-image-gui-<MACHINE_NAME>.sdcard of=/dev/sd[b|c|d|e] bs=1MB
I've just installed RASPBIAN 3.18 and next packages:
wget http://mirrordirector.raspbian.org/raspbian/pool/main/b/bluez/bluez_4.99- 2_armhf.deb
wget http://mirrordirector.raspbian.org/raspbian/pool/main/libc/libcap- ng/libcap-ng0_0.6.6-2_armhf.deb
wget http://mirrordirector.raspbian.org/raspbian/pool/main/r/radvd/radvd_1.8.5- 1_armhf.deb
wget -O kernel.zip http://www.nordicsemi.com/eng/nordic/download_resource/41602/5/28710770
unzip kernel.zip
sudo dpkg -i radvd_1.8.5-1_armhf.deb
sudo dpkg -i libcap-ng0_0.6.6-2_armhf.deb
sudo dpkg -i bluez_4.99-2_armhf.deb
sudo dpkg -i linux-image-3.17.4-release+_1_armhf.deb
sudo dpkg -i linux-headers-3.17.4-release+_1_armhf.deb
sudo nano /boot/config.txt
Add the following line:
kernel=vmlinuz-3.17.4-release+ to config.txt
save and exit
sudo reboot
and when I restart I got an screen more or less as the print screen attached. Any idea ?
One thing is sure: The rainbow screen means the GPU firmware is loaded, but there is a problem with the kernel image. Which one? Impossible to say from here. Perhaps not found or corrupt. Might be that the kernel you got from www.nordicsemi.com is broken. Might be you have a typo somewhere. But it can also be a faulty SD-card. Or a wrong power supply. According to Google:
In some cases (Stuck on the Rainbow Screen), freezing at this point has been fixed by adding "boot_delay=1" to the config.txt file.
If nothing helps, you probably have to go back to the default Raspian kernel. If you need a more recent kernel than in the default Raspian, you can switch to Raspian testing. The testing kernel should be a bit more recent... and definitely works for me.
This might also help you (https://www.raspberrypi.org/forums/viewtopic.php?t=58151)
Error ACT LED patterns
While booting the ACT LED should blink in an irregular pattern, indicating it is reading from the card. If it starts blinking in a regular (Morse code like) pattern then it is signaling an error.
When it blinks just once: possibly you have a Rpi from Micron. Take a good look at the processor if it says M with an orbit around it, then using the latest software ( after Sept 2013 ) will solve your problem. Also make sure you have a 4Gb SD card: a 2Gb doesn't work in this particular case.
Other patterns that might appear during a failed boot mean:
3 flashes: start.elf not found
4 flashes: start.elf not launch-able (corrupt)
7 flashes: kernel.img not found
8 flashes: SDRAM not recognized. You need newer bootcode.bin/start.elf firmware, or your SDRAM is damaged
Firmware before 20th October 2012 required loader.bin, and the meaning of the flashes was slightly different:
3 flashes: loader.bin not found
4 flashes: loader.bin not launch-able (corrupt)
5 flashes: start.elf not found
6 flashes: start.elf not launch-able
7 flashes: kernel.img not found
This call fails on Solaris with EACCES when ran as ordinary user:
sem_open(fileName.c_str(), O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, 1);
When process is started as root, it runs fine. Is this expected behavior?
Environment:
$ uname -a
SunOS solaris 5.11 11.0 i86pc i386 i86pc
$ g++ --version
g++ (GCC) 4.5.2
At the command line try:
prctl $$
These are the system enforced resource limits your process has. Note there are
process.max-sem-ops
process.max-sem-nsems
project.max-sem-ids
These are limits that have a number, if you do not see them (or the limits are already reached) then you have to add them to your account's profile with projadd or projmod to increase them if your project already exists.
If you cannot do this (no root access) consult with your sysadmin, s/he probably has some reason for not allowing semapahore access.
Note carefully:
sempahores are kernel persistent. If you ran your code a bunch of times the sempahores you created are likely still out there.
To see existing semaphores try ipcs -as
To remove lingering sempahores that your code should have removed use ipcrm
I am trying to learn Device Drivers and tried to compile a code, but I get the below error messages. I would appreciate if you give me pointers to resolve this issue
cat: /dev/chardev: No such device or address
Below are the logs:
#ubuntu:~/Desktop/C_code$ lsmod
Module Size Used by
chardev 12767 0
#ubuntu:~/Desktop/C_code$ ls -l /dev
crw-rw-rw- 1 root root 77, 0 2011-10-03 20:47 chardev
~/Desktop/C_code$ uname -r
2.6.38-8-generic
I am using the code from the following site "http://tldp.org/LDP/lkmpg/2.6/html/x569.html"
Try: cat ~/Desktop/C_code/dev/chardev. That file isn't necessarily in /dev yet, but you could copy it there.
the problem is basically that the major and minor number represented by the device node /dev/chardev don't represent a device. put in your source code a printk of the major and minor number just after the'ye assignment.
check if the numbers in the kernel log match 77 0 as the device node declare.
if not, delete the device node, and write the following command
sudo mknod /dev/chardev c <MAJOR> <MINOR>
of course the major and minor are the ones you printed to the kernel log.
good luck.
http://tldp.org/LDP/lkmpg/2.6/html/x569.html, here
chardev is created in current working directory.So you should cat chardev in your current directory not in /dev/. Or create chardev in /dev/ directory instead.