Why does my system change my device from /dev/sdj to /dev/xvdj? - amazon-ec2

I have an Amazon EC2 instance. I booted up a volume and attached it to /dev/sdj. I edited my fstab file to have the line
/dev/sdj /home/ec2-user/mydirectory xfs noatime 0 0
Then I mounted it (sudo mount /home/ec2-user/mydirectory)
However, running the "mount" command says the following:
/dev/xvdj on /home/ec2-user/mydirectory type xfs (rw,noatime)
What? Why is it /dev/xvdj instead of /dev/sdj?

The devices are named /dev/xvdX rather than sdX in 11.04. This was a kernel change. The kernel name for xen block devices is 'xvd'. Previously Ubuntu carried a patch to rename those devices as sdX. That patch became problematic.
https://askubuntu.com/a/47909

Related

MacOS Catalina read-write mount could not be mounted in single user or recovery mode with permission denied

I need to have writable access to the file system in recovery mode, but I always get the error
mount_apfs: volume could not be mounted: Permission denied.
I am aware of others who solved it like this: Read-only file system" with SIP disabled in macOS Catalina
i.e.:
start in recovery mode (Cmd-R at startup)
open terminal and disable SIP with csrutil disable
reboot into single user mode (Cmd-S at startup)
check SIP is disabled with csrutil status
try to mount the volumes with read/write:
sudo mount -uw /
sudo mount -uw /System/Volumes/Data
Neither of the two volumes can be mounted, I always get permission denied even with SIP disabled.
Interestingly, even if I boot the Mac from an external SSD (in this case an old Sierra installation) I cannot mount the disk as read/write.
Any further suggestions?
The problem in this case was a defect SSD, which switched into readonly mode after only 36 TB written, despite having a design of 1200 TBW.
Unfortunately, MacOS did not report this. When looking at System information > Storage > my SSD > SMART status the system still showed "Verified", which is supposed to mean that everything is ok.
It was not.
I determined this by installing smartmontools and running a check:
brew install smartmontools
smartctl -a disk1
it showed e.g.:
SMART overall-health self-assessment test result: FAILED
- Available spare has fallen below threshold
- media has been placed in read-only mode
- Data Units Written: ... 35,4 TB
- Available Spare: 1%
- Available Spare Threshhold: 10%
So issues
bad luck with SSD
bad error reporting by MacOS

Netatalk on RPi, resulted in hfs+ drive read-only on RPi and not mounting on macOS

Background
I was trying to use netatalk to create Time Capsule using an Raspberry Pi 3, following the tutorial here. Some version info:
netatalk 3.1.12
macOS 10.14.5
Raspberian 4.19.50-v7+
Issues and findings
After reaching the last part of the tutorial, and able to connect over afp://, I realised that the volume is read-only.
I re-read the tutorial and realised that I didn't do the first step, because the drive is already HFS+. My guess is the ignore ownership on this volume is essential for netatalk to work properly.
Result / Symptom list
[✔︎] able to connect over afp://
[✔︎] able to mount the external drive on RPi
[𝝬] mounted drive on RPi is read-only
[𝝬] some of the directory can't be read, neither RPi nor via afp://
i.e. cp result in cp: cannot open 'filename' for reading: Permission denied
[𝝬] unable to mount the external drive on macOS
[𝝬] volume is read-only on macOS over afp://
The configurations used
/etc/fstab
proc /proc proc defaults 0 0
PARTUUID=7e67b292-01 /boot vfat defaults 0 2
PARTUUID=7e67b292-02 / ext4 defaults,noatime 0 1
/dev/sda2 /media/tm hfsplus force,rw,user,auto 0 0
/etc/netatalk/afp.conf
; Netatalk 3.x configuration file
;
[Global]
; Global server settings
; [Homes]
; basedir regex = /xxxx
;[My AFP Volume]
;path = /media/tm
[Timestone]
path = /media/tm
time machine = yes
/etc/nsswitch.conf
passwd: files
group: files
shadow: files
gshadow: files
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
/etc/avahi/services/afpd.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=TimeCapsule</txt-record>
</service>
</service-group>
Attempts to fix
macOS mount doesn't work
macOS force mount doesn't work
macOS gui diskutil first aid is unable
macOS cli diskVerify is unable to mount and stopped
macOS cli diskRepair is unable to mount and stopped
RPi fsck does not seems to fix the problem
RPi fsck.hfsplus does not seems to fix the problem
Questions and directions
The drive is able to be mounted read-only with some barred access on RPi, the data is likely to be safe. Currently, the drive refuses to mount on macOS, so I can't use macOS to enable the ignore ownership on this volume.
How come the volume (HFS+, created and used on macOS) is mountable on RPi after the tutorial and became unmountable on macOS afterwards?
Give the symptoms, is there any key step that cause this (besides not check ignore ownership on this volume)?
Are there some tracks as a resolution? to either:
mount the drive on macOS, which allow me to fix the permission and backup the data
fix the permission on RPi, so the backup and be done via afp://
or, any better suggestions to overcome these obstacles.
This was driving me up the wall for a week. I take it you are trying to do this from the howtogeek or techradar article?
After the installation, from the raspberrypi I shutdown the system:
sudo shutdown -h now
I unplugged my pi then restarted it (plugged it back in) and ran the following commands:
sudo service avahi-daemon start
sudo service netatalk start
sudo systemctl enable avahi-daemon
sudo systemctl enable netatalk
It worked and I am up and running with my Time Machine!! Hope this helps!

Resizng data disk on Alicloud

I have a production server running CentOS 6.9 on Alicloud in China. Instance is of ecs.sn1.3xlarge type. Recently one of my data disk became filled-up. So I decided to resize the volume and followed the step by step instructions available on this page: https://www.alibabacloud.com/help/doc-detail/25452.html.
Here are steps that I followed:
Resized disk form console
Rebooted system (Rebooting system didn't resized/populated disk on system)
umount disk
Run fdisk on desired disk
e2fsck -f /dev/vdb1 # check the file system
resize2fs /dev/vdb1 # resize the file system
Thank you in Advance

WoeUSB creating bootable USB not working

I am using Ubuntu 18.04, woeUsb, 15 GB usb3 Stick, windows 10 64Bit ISO to create bootable device. I found few tutorials how to do it, but I still get error.
Installation failed!
Exit code: 256
Log:
WoeUSB v##WOEUSB_VERSION##
============================== Mounting source filesystem... Wiping all existing partition table and filesystem signatures in /dev/sda...
wipefs: error: /dev/sda: probing initialization failed: No medium
found The command "wipefs --all "${target_device}"" failed with exit
status "1", program is prematurely aborted Unmounting and removing
"/media/woeusb_source_1532252869_8362"... You may now safely detach
the target device
I tried to format my USB several times but nothing worked. I used FAT32 format. Should I first convert it to NTFS?
I have the same issue and found the solution by unmounting USB drive in this way,
Go to the Disks and select your USB drive from the left side menu, and click on the icon shown in the below image to unmount USB.
The command line version of the tool works better in my experience:
woeusb --device Win10_1909_English_x64.iso /dev/sdX --target-filesystem NTFS
/dev/sdX might be different on your system such as sda sdb ..., make sure to check the device path using gparted or fdisk.
Make sure to set the filesystem to NTFS with --target-filesystem NTFS as FAT32 doesn't support large files.
I found that you have to run the software with sudo because it requires the use of gparted. If you don't do this it won't succeed and exit. I suspect this is your problem. I had a similar problem.
I had the same problem but after surfing internet I found something like this: **
sudo woeusb --device image.iso /dev/sdb --tgt-fs NTFS --verbose
**. So in the command image.iso is the OS you downloaded(or the path to it), while the /dev... is the USB device and type of format(NTFS). Just copy the command, change image.iso to the path of your image.iso and change the /dev/sdb to the name of your USB device and make sure you are connected to internet because when I ran the command it seems it communicated with GitHub. Good luck I hope this will help if you haven't found any answer.
There is no need to use any third party tool in the Windows operating system to create a bootable USB. Follow the below commands:
1. Plug your USB drive
2. Open Command Prompt
3. Type: diskpart .
4. Type list volume (this will show your drives)
5. Type sel vol h (h can be replaced with ur usb volume, can be anything g, h, i)
6. Type active
7. It will make your USB active, copy and paste windows files inside it.

Resize Virtualbox Ubuntu VM storage not taking effect

I followed these instructions to resize my VirtualBox Ubuntu VM on Mac:
http://osxdaily.com/2015/04/07/how-to-resize-a-virtualbox-vdi-or-vhd-file-on-mac-os-x/
This is after the change:
*****-M-D2KA:$ VBoxManage showhdinfo ~/VirtualBox\ VMs/P4_Runtime/P4_Runtime.vdi
UUID: ce0ccd77-f265-46cd-9679-e25e64f1c992
Parent UUID: base
State: locked read
Type: normal (base)
Location: /Users/*****/VirtualBox VMs/P4_Runtime/P4_Runtime.vdi
Storage format: VDI
Format variant: dynamic default
Capacity: 25000 MBytes
Size on disk: 9967 MBytes
Encryption: disabled
In use by VMs: P4_Runtime (UUID: 5ea52b11-997f-45d8-b7d6-effa37a3b649) [Snapshot 1 (UUID: 409c1035-2134-4532-a931-a29018d33dc6)]
Child UUIDs: 540ae750-5307-44ef-a313-95134ae353b7
165fe99e-490d-4dd9-9602-00e3aaa8f82c
But for some reason, it does not seem to take effect:
This is the "df -k" output in the VM, and I get "No space left on device" error:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda 10253588 9713020 0 100% /
What am I missing?
I found out what I missed. I used gparted to resize the partition.
Resizing the VHD doesn't change the size of the partition /dev/sda. You can run lsblk inside the guest to see the additional space. To get the extra space that is available in the guest OS, you may
Use something like gparted as mentioned here. Instructions to do that on VHD can be found here. Note that this might not be easiest, but you may be forced to if you plan to not move some of your mount points (Example if you're not ready to move /home/ to a new partition).
Or, create a new partition, again instructions on how to do is present here. I would prefer this option over the first.

Resources