Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediacard/sdhc-storage-manual case fail with NTFS #1587

Open
1 task done
scotthu27 opened this issue Nov 8, 2024 · 2 comments
Open
1 task done

mediacard/sdhc-storage-manual case fail with NTFS #1587

scotthu27 opened this issue Nov 8, 2024 · 2 comments
Labels
bug Something isn't working cert-blocker test case

Comments

@scotthu27
Copy link
Contributor

scotthu27 commented Nov 8, 2024

Bug Description

checkbox try to mount SD card, which already auto mounted by system.
FAT32 could be mounted twice, but NTFS not.

FAT:

$ lsblk -f
mmcblk0
└─mmcblk0p1 vfat FAT32 3634-6530 14.5G 2% /tmp/tmpwejknovw
/media/ubuntu/3634-6530

NTFS:

$ lsblk -f
mmcblk0
└─mmcblk0p1 ntfs NTFS 019F72A27CD70D27 14.7G 1% /media/ubuntu/NTFS
$ sudo mount /dev/mmcblk0p1 /mnt
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.

Cert-blocker Test Case

  • cert-blocker

To Reproduce

checkbox-cli run com.canonical.certification::mediacard/sdhc-storage-manual

Environment

Checkbox Type: Debian
Checkbox Version: 4.2.0~dev127 ~ubuntu24.04.1

Relevant log output

$ sudo checkbox-support-run_watcher storage mediacard_combo

--------- Testing insertion ---------


INSERT NOW


Timeout: 30 seconds
INFO:usable partition: mmcblk0p1
INFO:Device: ultra high speed SDR50 SDHC
INFO:Address: e624
INFO:Mediacard insertion test passed.

------- Insertion test passed -------

--------- Testing read/write --------
DEBUG:generating a random file
Mounting the USB storage
mmcblk0p1
DEBUG:try to mount usb storage for testing
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.
ERROR:mount /dev/mmcblk0p1 on /tmp/tmpncdsflhi failed.
INFO:context manager exit: unmount USB storage
umount: /tmp/tmpncdsflhi: not mounted.
WARNING:umount /tmp/tmpncdsflhi failed.
INFO:Remove temporary folders and files.

Additional context

No response

@scotthu27 scotthu27 added the bug Something isn't working label Nov 8, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1648.

This message was autogenerated

@scotthu27
Copy link
Contributor Author

journalctl.log

Jefferyyen added a commit to Jefferyyen/checkbox that referenced this issue Nov 13, 2024
Hi,
I also ran into this issue:
canonical#1587

I tried this change on my DUT and it works for mediacard test.
Jefferyyen added a commit to Jefferyyen/checkbox that referenced this issue Nov 14, 2024
…l#1587)

To prevent the inserted storage from failing to mount twice, first ensure it is unmounted.

Because the OS will auto-mount the inserted storage, the existing subprocess.call(["mount", device_to_mount, FOLDER_TO_MOUNT]) command will cause an error if the format of inserted storage is NTFS.

Perform an umount on device_to_mount (e.g., for the media card in canonical#1587, it would be umount /dev/mmcblk0p1) before attempting to mount it again to avoid this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cert-blocker test case
Projects
None yet
Development

No branches or pull requests

1 participant