Formatting a MicroSD card within OSX - macos

I am trying to format a 32GB MicroSD card using the Disk Utilities app in OSX
however I am receiving this error:
I need that for processing with this manual.

Firstly write this command in the terminal:
diskutil list
Then it will show a list of disks. Find the one which caused the problem and use this command for it:
sudo diskutil unmountDisk /dev/disk4
Now it should be erased successfully if you get back to the Disk Utilities program.

Related

Operation not permitted when trying to open tmux

When I try to initiate tmux session it gives me the following error.
error creating /private/tmp/tmux-501 (Operation not permitted)
I am using apple M1 (Big Sur version 11.5.2). Any suggestion?
It was not just with tmux but I couldn't read/write on the /tmp folder even with sudo permission. This blocked me from using apps that require its use.
I couldn't find the actual reason behind it, I think it was locked by another program which terminated badly.
The only option I could have opted for at this point was to reboot my system.

cannot mount usb partition - unknown file system exfat

I have a USB stick with important info that would not show up in Windows. I tried the Disk Management Utility, and the partition with the data shows up as "healthy", but no drive letter, and right-click menu options all grayed out (except 'delete'). I used another laptop, I used a Macbook, all to no avail.
On Ubuntu, it also would not show up. I tried manual mounting, which did not work, and on parted it the "File system" column is empty.
Using fdisk -l it shows as HPFS/NTFS/exFAT.
???
I thought to remove my question, but since it took me a while to find the answer, others may benefit:
sudo apt install exfat-fuse exfat-utils
Now I could mount it with exfat specified as file system (and anyway now Ubuntu also automatically mounted it).
uanble to mount exfat file system then needs to follow below steps
Open a terminal (Ctrl+Alt+T shortcut in Ubuntu).
sudo add-apt-repository universe
sudo apt update
sudo apt install exfat-fuse exfat-utils

linux file system layout -partiton - fdisk

I am tyring to understand linux file system layout. Why does the command work inside virtual box but not on linux shell on windows?
I tried to use the command sudo fdisk -l dev/sda on both my virtual box(Ubuntu) and Ubuntu on windows(from microsoft store). It didn't work on any of them but when I changed the command to sudo fdisk -l, it worked inside virtual box but not on linux bash shell on windows.
Inside linux shell on windows:
:~$ sudo fdisk -l /dev/sda
.
fdisk: cannot open /dev/sda: No such file or directory
:~$ sudo fdisk -l
fdisk: cannot open /proc/partitions: No such file or directory
:~$ man fdisk
:~$ whereis fdisk
fdisk: /sbin/fdisk /usr/share/man/man8/fdisk.8.gz
The fundamental of Windows Subsystem for Linux (WSL) - Ubuntu is a POSIX emulator which is like Cygwin kind of environment helps to port some Linux based commands/applications running on windows platform as windows process.
It contains an abstraction layer of a virtual filesystem (vfs) which has read-only app image & RAM based writable tmpfs and neither it doesn't have access control to read the raw devices on host system nor it emulates the raw devices for the subsystem.
from man(fdisk) :
Description
This command is used to create and modify the partition table, and to install the master boot (IA only) record that
is put in the first sector of the fixed disk. This table is used by
the first-stage bootstrap (or firmware) to identify parts of the disk
reserved for different operating systems, and to identify the
partition containing the second-stage bootstrap (the active Solaris
partition). The rdevice argument must be used to specify the raw
device associated with the fixed disk, for example,
/dev/rdsk/c0t0d0p0.
So WSL-Ubuntu can't execute the fdisk command successfully since it doesn't have its own kernel to manage host resources.
On the other hand, Oracle's VirtualBox is a virtualized system which imitates a fully functional OS running on bare metal. It simulates its own system-space & user-space with the help of virtualization hypervisor and manages the virtual resources via the Guest OS kernel. This is why fdisk command execution was successful on VirtualBox
Reference :
https://www.microsoft.com/en-us/research/wp-content/uploads/2013/01/posix-emulation-submitted.pdf
Credits: https://www.quora.com/How-is-Windows-Subsystem-for-Linux-different-from-running-Linux-on-Windows-in-a-VM

target disk is too small on reboot

I'm trying to reinstall OSx on my macbookpro 13 2010. Right when it was about to install, I get the error that target disk is too small. I reboot it again and open the terminal and type:
diskutil list
And get this result:
result of typing diskutil list
I see that diskutil has many helpful commands which can erase or merge volumes and disks. However, I'm not sure which ones are safe or exactly how to go about doing this. What should I do next?
Follow these steps and let me know if it helped:
diskutil list
diskutil apfs deleteContainer disk0s2 - this will delete the apfs partition that is currently active.
again, diskutil list
diskutil partitionDisk /dev/disk0 gpt apfs macOSX 250 - this will create a new partition for you named macOSX
Now try to re install the OS to this drive. I am sure it will succeed. Revert back if any more queries exist.
I know this is an old thread but I found an easy solution for this.
First erase the disk with disk utility using erase and then just create another partition on it and install the OS to the new partition. Don't know why but it works.

Can't mount Android Things image file in OS X to tweak config files

Some tutorials recommend making modifications to files such as wpa_supplicant.conf within the Android Things image file, as per this answer https://stackoverflow.com/a/41732035/766115. I'm trying with the Android Things developer preview 4.1 image file.
However, I've had no luck mounting this file for editing purposes on OS X. Various attempts to use os x Disk Utility or the mount command from the terminal all result in some type of error message telling me the file format is not compatible. I can see in Disk Util, or through terminal mount, that the ISO image has 15 sectors (or partitions), but I can't access them.
I've even tried spinning up an Ubuntu in AWS, uploading and mounting from there. No dice.
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
Any advice? What am I missing.
On macOS I have done this way:
Connect the sdcard on your Mac
Run on terminal diskutil list and see the name of your sdcard (in my case /dev/disk2s1)
Create a directory where the sdcard will be mounted: sudo mkdir -p /Volumes/pisdcard
Mount the sdcard: sudo mount -t msdos /dev/disk2s1 /Volumes/pisdcard
Edit what you want and unmount the sdcard with: sudo umount /dev/disk2s1
It worked for me, I used to change config.txt and cmdline.txt to change UART mode and use a GPS module on Android Things.
hdiutil attach [file] is the macOS command to treat an image file as a disk device. If the image file contains a filesystem macOS can read, it should also mount any volumes contained in the file. If your image contains a volume not supported by macOS (e.g., ext4), you also need to install an appropriate driver before you can mount the volume.

Resources