Thursday, September 12, 2024

revisiting dvd backups

Someone had been gifted a box set of 16 DVDs, but they were unable to play them due to region restrictions. They asked me for help. So, revisited DVD Decrypter after more than 15 years. Still works fine on Windows, except that with Win10, while exiting, it gives a few error dialog boxes, 'Failed to set data for '' ' and so on. 

On Linux, DVD Decrypter under Wine is supposed to work with SCSI emulation, but I was unable to get it to recognize the DVD drive - the links in ~/.wine/dosdevices  f:: and f: are being automatically assigned correctly to link to the device /dev/sr0 in my case and the mount point respectively, so probably the need is to go to nt40 mode. But my .wine directory did not have a config file, as mentioned in the howto section at

https://appdb.winehq.org/objectManager.php?sClass=version&iId=2587

and even creating a config file did not solve the issue. Probably someone who knows more about wine can get it to work. There are also other options as mentioned in the old wiki page at

https://help.ubuntu.com/community/RestrictedFormats/RippingDVDs

But my purpose was served by dvdbackup. Handbrake also worked, but I wanted a decrypted copy which I would encode later, so I used dvdbackup instead.

sudo apt install libdvdcss2

sudo apt install handbrake

sudo apt install dvdbackup 

mkdir new12

cd new12

 dvdbackup -i /dev/sr0 -M -v

and in another window, 

 watch du -sh new12

to see the progress as the GBs get added.

The macbook's DVD drive worked fine, as also the Windows desktop's drive. But the Lenovo laptop's DVD drive seemed to be more sensitive to scratches. The macbook's drive was probably the best. Decrypting and writing to hard drive was probably limited by DVD drive's speed, around 4x, taking 20-25 minutes per disc.

Encoding with handbrake directly from DVD on the macbook was going at approx 23 fps for the "Fast 576p" encoding method, while on the newer Samsung Galaxy Book2, handbrake encoding with the decrypted files on hard disk was going at 130 fps for "Fast 576p" and 250 fps for "Very fast 576p" - and so I went for the latter, reasonable quality. With such speeds, each disc would get encoded in under 10 minutes.


 

Sunday, September 08, 2024

revive corrupt sdcard for raspberry pi

According to the section on reviving corrupt SD cards in this page,

https://thelinuxcode.com/format-sd-card-raspberry-pi/

I tried out F3 to check for corruption.


https://medium.com/@drawn_stories/how-to-find-if-your-thumb-drive-sd-card-is-fake-with-f3-linux-tutorial-f0109bef63ea

sudo apt install f3

(I didn't need to use lsblk since I knew the sdcard was /dev/sdc for me.)

(instead of sudo umount, I used GParted to repartition to a single Fat32 partition first, and then unmounted within GParted.)

sudo f3probe --destructive --time-ops /dev/sdc

reported that everything was fine, finished in around 2 minutes.

Then, disconnected and re-connected to mount the drive, and then

f3write /media/myusername/mymountpoint

showed it would take 50 minutes for this 32 GB drive. Again, no errors.Then, 

f3read /media/myusername/mymountpoint

Also no errors. Took around 20-25 minutes. 

Then, tried cloning the working sdcard image again, into this sdcard which had failed last time

gunzip -c my-root-boot.image.gz | dd of=/dev/sdc conv=noerror status=progress

This took a bit over three hours.

31914983424 bytes (32 GB, 30 GiB) copied, 11300.6 s, 2.8 MB/s

(3.13 hours)

Completed successfully.

 



 


Saturday, September 07, 2024

deleting a Microsoft account linked to an Azure free trial

After a month of the free trial, an email reminded me to upgrade to 'pay as you go' and add a payment method (credit card) to continue to use the free services for a year. I did so. But I did not have much use for the free trial - I had tested it out for downloading from 1and1's cloud platform IONOS which some collaborators had used, and which was timing out using BSNL fiber due to downloading at around 30 Mbps. Similarly, Google Drive shared files also would time out after an hour or so.

I had found that the workaround of using rclone was a better and easier alternative to (a) create a free trial (b) create a VM (c) download on the VM (d) download from the VM to my local machine. 

So, when I got an email from Microsoft saying that all Azure logins would need multi-factor authentication (MFA), I thought I would just delete the Azure free trial subscription and the associated microsoft account.

For this, 

and Microsoft account -
 
Just going to the 'close account' link in the above support page, first tried after 'Cancel'ling the Azure subscription. Apparently, that is not enough. 30 minutes after we 'cancel' the subscription, a 'Delete' subscription button become active - we have to 'Delete' the subscription.
 
It is only after we delete the azure subscription that we can exit the tenant - had to delete tenant and not exit the tenant because this account was the sole user and hence the 'Global Administrator' for this tenant - before it allowed to close microsoft account -
https://learn.microsoft.com/en-us/entra/identity/users/directory-delete-howto
 
After the 'delete microsoft account' page completed, it just dropped me into login.live.com which asks me to log in - no confirmation page that the account has been marked for deletion etc.

If I try to log in with the account marked for deletion, it says that this account is marked for deletion, and logging in will unmark it for deletion, so we need to choose 'Cancel'.  
 
So, in short, the steps were:
1. Cancel the subscription from Azure portal
2. Wait 30+ minutes, then delete the subscription from Azure portal
3. Wait for a few minutes for their servers to update, then delete the tenant from Entra Admin Centre
4. (Wait a few minutes for their servers to update?), then delete the microsoft account from the link on the support page.
 
 

Monday, September 02, 2024

raspberry pi not booting, error writing to SD card when reflashing with dd

One of the Raspberry Pis we use for video play-out in the waiting area was not booting. Simplest test was to use the other Pi's SD card and try booting with that one - worked. So, wanted to image that mini SD card to the one which was not booting. 

https://www.cyberciti.biz/faq/unix-linux-dd-create-make-disk-image-commands/
sudo dd if=/dev/sdc conv=sync,noerror bs=64K | gzip -c > my-root.image.gz
took around 45 minutes -
32 GB SD card with 5.5 GB used with df -h, due to gz it became 7.7 GB

Could monitor through watch -
https://www.baeldung.com/linux/dd-monitor-progress

watch -d ls -alh my-root.image.gz

But when trying to write back to the sdcard which was not booting (file system tests showed no errors after 'repairing'), 

sudo su -
# gunzip -c my-root-boot.image.gz | dd of=/dev/sdc status=progress

But after 10 minutes or so,

dd: writing to '/dev/sdc': Input/output error

https://superuser.com/questions/35349/dd-clone-hard-drive-input-output-error-though-chkdsk-says-ok

Tried conv=noerror -

gunzip -c my-root-boot.image.gz | dd of=/dev/sdc conv=noerror status=progress

Still the same error.

Then tried writing the disk image to another (64 GB) mini-sdcard which happened to be here. That worked without errors, and the R Pi booted up fine. So, maybe there are some physical errors, we might need to reformat (full format) and copy the files back (instead of cloning.)