I am trying to change a file in the vfat partition on a card with raspbian on it.
The boot partition is vfat.
After mounting it I tried changing a file on it with vim, nano and gedit (in the GUI), even overwritten it with cp, but if I remove and reinsert the card reader in the computer, the changes are reverted.
I also tried using the sync command after editing with no avail. And I was using root in all cases.
Could anybody please tell me how to permanently edit the files on the card?
Related
I am running ubuntu 18.04, kernel 4.19.94-ti-r36, on a a beaglebone black. I am connected to ssh, and am trying to adjust the boot configuration of the GPIO pins. After boot, I am able to change and query individual GPIO configurations with the "config-pin" command, which is useful for experimentation. But I would like to change all the default GPIO configuration on boot, which this tool does not appear to do.
I found this tutorial on using a device overlay to achieve this here:
http://derekmolloy.ie/gpios-on-the-beaglebone-black-using-device-tree-overlays/
but I am missing the "bone_capemgr.8" directory. I googled this issue and was directed to this page, which says that device tree overlays are now deprecated, and to use u-boot overlays instead:
https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays.2C_which_got_loaded
I read through the article, and googled around, but I haven't found anything on how to actually use a u-boot overlay to change the configuration of the GPIO pins on boot.
Does anyone know how to do this, or know where I might find a good resource to this effect?
Thanks!
Edit: here are the steps I think I need to take, based on De Funct's answer:
install bb.org-overlays found here, https://github.com/beagleboard/bb.org-overlays, with:
sudo apt install bb-cape-overlays
create a .dts file with the correct configuration
compile .dts-->.dtbo file:
dtc -O dtb -o out_file.dtbo -b 0 -# in_file.dts (or something similar?)
adjust this line in /boot/uEnv.txt file to reference compiled dts
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/.dtbo
something to do with boot images (?)
Questions:
what does searching "in the kernel" mean? how would I do this?
for the actual .dts file, I looked around and found this as a starting point:
https://github.com/derekmolloy/boneDeviceTree/blob/master/overlay/DM-GPIO-Test.dts My plan is to modify/extend lines 29-33 to change the boot configuration of all relevant pins. The second hex number is the pin mode I'm trying to change; that makes sense. The first hex number looks like it somehow corresponds to pin number, but I'm not sure how? for example, 0x078-->P9.12,0x184-->P9.24, etc.
when/where does making an image come into play? what about making two different partitions? I didn't follow that part
to use the uboot-overlays, which is a given for most concepts with GPIO pins on the BBB, one would have to install bb.org-overlays which are found here, https://github.com/beagleboard/bb.org-overlays, and to understand Device-Tree Specifications.
https://github.com/beagleboard/BeagleBoard-DeviceTrees will help you, too.
The Device Tree specification can be found here: https://www.devicetree.org/
In the kernel, you can search the docs. and kernel for specific, already-made device tree ideas and files.
Also, it is as simple as creating your dts file, compiling it, and putting it in the correct space on the BeagleBone Black in /boot/uEnv.txt.
For instance, if I had a specific .dtbo that I compiled from my .dts file(s), I would simply put it in the /boot/uEnv.txt file under this heading...
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/<file0>.dtbo
http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays should explain the ideas I am listing.
Oh! Also, when creating your image, one would have to create the two partitions, one for booting and the other for the actual OS/filesystem.
Once this is completed, one would have to install the file uEnv.txt in the /boot dir. by simply making the file in a text editor, saving it, and placing it in the system before compilation via make menuconfig or whatever you are using to install the boot partition and OS partition.
If you need exact placements of the files in the kernel to search under for the .dts, .dtb, and .dtbo files, ask away. I have had complications with this before and lacking understanding, I have been a drift. Luckily, there is a long list of ideas but one needs to make them accessible in the correct order.
Also: https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black are some ideas on how to start the image factory of making things available for the BeagleBone Black.
Edit: here are the steps I think I need to take, based on De Funct's answer:
install bb.org-overlays found here, https://github.com/beagleboard/bb.org-overlays, with:
git clone https://github.com/beagleboard/bb.org-overlays
create a .dts file with the correct configuration
Your configuration of the .dts file works too...(supposedly as I have not seen it).
compile .dts-->.dtbo file:
dtc -O dtb -o out_file.dtbo -b 0 -# in_file.dts (or something similar?)
Not this idea. Although, compiling using the device-tree-compiler is an option, I say use their build script w/ their Makefile.
So, try ./install.sh
adjust this line in /boot/uEnv.txt file to reference compiled dts
###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/your_newly_added_file.dtbo
...
Also and excuse me if this does not work, you can try with the BeagleBoard-DeviceTrees link I provided.
In that one, you would simply place the correct file, your .dts file, in the /src/arm/ directory, and go back to the BeagleBoard-DeviceTrees/ dir. to perform the make command.
It will perform all the necessary .dts to .dtb to .dtbo file operations.
This is the /boot/uEnv.txt file I have currently...
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0
uname_r=4.19.94-ti-r59
#uuid=
#dtb=
###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/BB-UART2-00A0.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=/lib/firmware/<file4>.dtbo
#uboot_overlay_addr5=/lib/firmware/<file5>.dtbo
#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
See where the file states #dtb=? That is section where the .dtb needs to be located and uncommented by removing the hash symbol.
Also, under that particular section of the file, there are u_boot-overlay sections. You can now add your .dtbo files in those particular slots.
I use rsync to make backups of my files located on my NAS to an USB device. I use the following command:
sudo rsync -rv --modify-window=9999 --update --delete --stats --progress --log-file=/shares/Franck/log/backup_photos.log /shares/Public/photos /USB_DRIVE/photos
Everything works fine provided that the USB drive remains attached to the NAS. That is to say, rsync copies new and changed file and nothing more.
However, from time to time I use the backup USB drive for other things and plug it to other windows and Mac machines (but I do not touch the /photo folder on the drive) and when I mount it again on the NAS and lauch a backup, rsync copies every single file again (even if it hasn't changed).
Do you know how to fix this? Thanks.
The drive is formatted in FAT32 format and that cannot be changed (I interact with Linux, Windows and Mac). I know this is not optimal for rsync but I have to deal with it (I do not care about keeping permissions informations and so on).
I've been trying to figure out the answer to this for a long time, with no success. But I've just stumbled across the answer. It's a FAT32 short-filename issue; apparently, by default, Linux converts them to all lower case, which messes up rsync's ability to see that it's the same file on the source & destination.
The solution is to mount the FAT32 device with the 'shortname=mixed' option. I believe you also need to use utf8 charset, e.g. 'iocharset=utf8'. Then run rsync with params: -rtv --modify-window=1
On Debian with Trinity, I can right-click the FAT32 partition's icon on the desktop, Properties / Mounting, set Short Names to mixed, and make sure UTF-8 Charset is checked. Hopefully there's a way to make those the defaults for all FAT32 partitions, but I haven't looked for that yet.
I wrote a simple udev rule to mount my compact flash card reader to a writeable device node. The rule was working earlier, but seems to have stopped for some reason, I was editing the file before, but now it just contains:
KERNEL=="/dev/sd*", ATTRS{model}=="Compact Flash ", SYMLINK+="compactflash-%k", MODE=="0666"
The file is called 90-cf-rule.rules and is located in /etc/udev/rules.d. If someone could point out what's wrong I'd be really grateful.
It looks like udevd is still running, and I run udevadm trigger after editing the rules file. I've tried plugging and unplugging the device. I'm also certain that the model matches as I copied and pasted from udevadm info and have had this rule working!
The correct udev filter is:
KERNEL=="sd*", ATTRS{model}=="Compact Flash ", SYMLINK+="compactflash-%k", MODE=="0666"
ie. The /dev/ is not required in front of the KERNEL argument. I must have put this in while editing the file earlier.
I used SARDU for multi-bootable live DVD. first I made live usb which made perfectly in which I can modified. then i try to made dvd in which i can't modify isolinx.cfg but in usb i can modify syslinux.cfg. How can i modify isolinux.cfg then how to boot cd?
A DVD is a write-once media. When the file isolinux.cfg has been "burned" to the DVD disk, there is no way to change it (well, you could scratch it away with a tiny pin ...)
You could use an overlay filesystem but that won't help because the boot loader doesn't support it (the file system needs the kernel, so the boot loader would need to start the kernel first to read its own config file).
[EDIT] One solution is to create copy the files from the DVD somewhere, make the changes and create a new DVD image (iso file) from that.
Next, make sure that the changes made it into the image (mount -o loop file.iso /mnt and then look at the files under /mnt. Don't forget to replace file.iso with the correct name of the ISO/DVD image file on your hard disk!!)
If that is OK, create a bootable USB stick with the DVD image. This way, you can test that the image actually boots without wasting DVDs.
When everything works, burn a DVD.
I'm running Ubuntu 10.10. As part of SD card creation, I have a script that successfully creates a raw disk image file, correctly formatted with an ext2 file system. I have built SD cards from the raw disk image file with dd.
Now, I'd like to mount it and browse the files using Nautilus.
I know I can use mount -o,loop to mount it to a mount point. I would like to get it mounted by gnome to an automatically created /media/xxx mount point. I have used partprobe /dev/loopn to get the file noticed. It appears in my Places menu and if I select it from there, nautilus opens the disk, just fine.
What I would like to do is get my script to kick nautilus so its file browser window opens the image file's root without having to select it from the Places menu.
You could also use gvfs-mount.
List mountable devices
gvfs-mount -li
Mount device file found above from label
gvfs-mount -d /dev/sdaX
Nautilus uses the same underlying library (gvfs)
After that you can use
nautilus /media/LABEL
if you know the path to the directory you can use gnome-open like:
gnome-open /media/xxx
You can use gnome-disk-image-mounter (probably with option --writable) to mount an image using Gnome, which itself will be available by Nautilus.
If you want a graphical application like Nautilus to browse the files, why do you not configure it to mount images by itself?
With 'right-click|Properties|Open With' you can just use gnome-disk-image-mounter to do the task you want, including opening the folder.
See my answer to another question to open the image writeable.