New to Nutbox?

ntfs and ubuntu linux

0 comments

gungasnake
49
12 hours agoSteemit10 min read

Hi, I am having a problem with my HP Z840 that I have to find a way to fix. It isn't letting me mount usb media, I get errors like:

Unable to mount xxx

Error mounting .dev.sdb1 at /media/bear/xxxxxxxxxxxx unknown error when mounting /dev/sdb1
ChatGPT said:
ChatGPT

The error you’re encountering when trying to mount USB media on your HP Z840 suggests there might be a problem with the system’s ability to recognize or access the USB drive correctly. Here are some steps to diagnose and potentially fix this issue:

  1. Check for Basic Hardware Issues

    Try different USB ports: Sometimes, the issue could be related to a faulty USB port. Plug the USB drive into different ports to rule this out.
    Use another USB drive: See if other USB drives can be mounted to identify if the problem is specific to a particular drive.

  2. Check the File System

    Run dmesg command: Open a terminal and type dmesg | grep sdb1. This command will show recent messages related to the drive /dev/sdb1. Check if there are any specific errors or indications of what's causing the issue.
    Check the file system for errors: Use the fsck command to check and potentially repair the file system on the USB drive:

    bash

sudo fsck /dev/sdb1

If the USB drive is formatted with an NTFS or exFAT file system, consider installing additional support packages:

bash

sudo apt-get install ntfs-3g exfat-fuse exfat-utils
  1. Check Permissions

    Make sure your user account has the necessary permissions to access and mount media. Run the following command to add your user to the plugdev group if necessary:

    bash

    sudo usermod -aG plugdev $(whoami)

    After doing this, log out and back in for the changes to take effect.

  2. Check if Automount is Enabled

    Ubuntu might have automount disabled. Ensure it’s turned on by running the following command:

    bash

    gsettings set org.gnome.desktop.media-handling automount true
    gsettings set org.gnome.desktop.media-handling automount-open true

  3. Try Manually Mounting the Drive

    You can attempt to manually mount the USB drive by following these steps:

    bash

    sudo mkdir /mnt/usbdrive
    sudo mount /dev/sdb1 /mnt/usbdrive

    Check if this works without errors. If you receive an error message during this step, it might provide more information about the problem.

  4. Check fstab and Other System Configurations

    Ensure there are no entries in /etc/fstab that could conflict with mounting USB drives automatically. Open the file with:

    bash

    sudo nano /etc/fstab

    Look for any references to USB drives and either comment them out with a # or remove them.

  5. Check Disk Health

    If none of the above steps resolve the issue, consider running a health check on the USB drive using a utility like smartctl:

    bash

    sudo smartctl -a /dev/sdb

    This can provide details about any potential hardware failures with the USB drive.

  6. Reinstall or Check Related Packages

    If the mounting utilities themselves are having issues, you might try reinstalling them:

    bash

    sudo apt-get install --reinstall udisks2 gvfs

If the problem persists, let me know what error messages you’re seeing after these steps so I can suggest further actions!
You said:
dmesg command produces an error msg:
dmesg: read kernel buffer failed: Operation not permitted
ChatGPT said:
ChatGPT

The dmesg: read kernel buffer failed: Operation not permitted error typically occurs because your user account does not have the necessary permissions to read the kernel buffer, which is restricted in many modern Linux distributions for security reasons. Here's how you can resolve this issue and continue troubleshooting:
Option 1: Use sudo with dmesg

You can run the dmesg command with sudo to gain the required permissions:

bash

sudo dmesg | grep sdb1

This should allow you to access the kernel buffer and view relevant messages about your USB drive.
Option 2: Check Kernel Logs with journalctl

An alternative to dmesg is using journalctl to access the system logs. This method also requires sudo privileges:

bash

sudo journalctl -k | grep sdb1

This will show kernel log entries related to /dev/sdb1.
Option 3: Grant Your User Permission to Read dmesg

If you want to avoid using sudo every time, you can temporarily allow read access to the kernel buffer by adjusting the kernel's logging parameters. However, keep in mind that this change is temporary until a reboot:

bash

sudo sysctl -w kernel.dmesg_restrict=0

This will disable the restriction, allowing you to run dmesg without sudo. To make this change permanent, you would need to edit /etc/sysctl.conf or create a configuration file in /etc/sysctl.d/.
After Viewing the Logs

Once you've gathered the log entries using one of these methods, look for error messages or warnings related to the USB drive (typically referencing /dev/sdb1 or sdb). This should provide you with specific details on why the system is failing to mount the USB drive.

If you find error messages or have additional information from these logs, let me know so we can continue troubleshooting!
You said:
using sudo:

[ 1866.314159] ntfs3: sdb1: It is recommened to use chkdsk.
[ 1866.365899] ntfs3: sdb1: volume is dirty and "force" flag is not set!
[13115.181043] sdb: sdb1
[13115.699603] ntfs3: sdb1: It is recommened to use chkdsk.
[13115.749875] ntfs3: sdb1: volume is dirty and "force" flag is not set!
[13371.850667] ntfs3: sdb1: It is recommened to use chkdsk.
[13371.853190] ntfs3: sdb1: volume is dirty and "force" flag is not set!
ChatGPT said:
ChatGPT

The log entries indicate that the USB drive uses the NTFS file system, and it is marked as "dirty." This usually means that the file system wasn’t properly unmounted or has some inconsistencies, which need to be repaired. The recommendation to use chkdsk suggests using a Windows utility to check and repair the NTFS file system.

Here’s what you can do to fix this:
Step 1: Use Windows to Run chkdsk

Connect the USB drive to a Windows computer.
Open File Explorer, right-click on the USB drive, and choose "Properties."
Go to the "Tools" tab, and under "Error Checking", click on "Check".
Follow the prompts to scan and repair the drive. This process uses the chkdsk (Check Disk) utility to check and fix any file system issues on the NTFS partition.

Alternatively, you can use the command line in Windows to force a full check:

Open Command Prompt with administrator privileges.

Run the following command, replacing X: with the actual drive letter assigned to your USB drive:

cmd

chkdsk X: /f

The /f flag instructs chkdsk to fix any detected errors.

Step 2: Safely Remove and Reinsert the Drive

After repairing the file system using chkdsk, safely remove the USB drive from Windows and reconnect it to your Linux machine. This should clear the "dirty" flag and allow the drive to mount correctly.
Step 3: Force Mount (Linux)

If for some reason you cannot access a Windows machine, you can attempt to force-mount the USB drive on Linux. However, this is not recommended unless absolutely necessary, as it could lead to further file corruption:

bash

sudo mount -t ntfs-3g -o force /dev/sdb1 /media/bear/usbdrive

Note: This command forces the mount with the ntfs-3g driver, but it should only be used if you cannot repair the file system in Windows.

If the issue persists or you encounter new errors, let me know the details, and we can look into alternative solutions.
You said:
I bought this computer on ebay and immediately tossed the hard drive that came with it. I replaced that with a new SSD and installed Ubuntu-Mate LINUX on it. How could it think it was doing anything with ntfs?
ChatGPT said:
ChatGPT

The NTFS-related issue is specific to the USB drive, not your system’s main SSD. It seems that the USB drive itself is formatted with the NTFS file system, which is common for external drives, especially if they were previously used on a Windows machine. When you try to mount the USB drive on your Ubuntu-MATE system, the kernel is recognizing the NTFS partition and attempting to access it.

Since you tossed the original hard drive and installed a new SSD with Linux, your system’s internal storage should be using a Linux-friendly file system like ext4, but the USB drive is likely using NTFS, which is why the system is encountering NTFS-specific errors.

To summarize, the NTFS issue isn't with your system SSD but with the USB drive itself. If you have any further questions or if you'd like to explore reformatting or fixing the drive, let me know!
You said:
Would it help to format some of these usb drives I use as ext4?
ChatGPT said:
ChatGPT

Yes, formatting your USB drives to ext4 can help, especially if you primarily use them with Linux systems. Here are the key benefits and considerations:
Benefits of Formatting USB Drives as ext4:

Native Linux File System: ext4 is the default file system for many Linux distributions, including Ubuntu. It provides better compatibility, performance, and reliability with Linux.
No Dirty Bit Issues: The “dirty” bit issue you encountered with NTFS is specific to that file system and would not occur with ext4.
File Permissions: ext4 supports Linux file permissions, which can be useful if you need to set access controls on your USB drives.
Better Handling of Large Files: ext4 efficiently handles large files and partitions, making it a good choice for drives with substantial storage capacity.

Drawbacks to Consider:

Limited Cross-Platform Compatibility: Windows and macOS do not natively support ext4. If you occasionally need to use these drives with non-Linux systems, this can be a problem. You would either need special software on Windows to read/write ext4 or consider an alternative like exFAT (which has broad compatibility).
Data Loss: Formatting will erase all existing data on the drive, so you’ll need to back up any important files before proceeding.

Steps to Format USB Drives to ext4 on Linux:

Back Up Data: Ensure you’ve backed up all necessary data from the USB drive.

Identify the USB Drive: Plug in the USB drive and run lsblk to list all block devices. Identify the drive, e.g., /dev/sdb.

Unmount the Drive:

bash

sudo umount /dev/sdb1

Format to ext4:

bash

sudo mkfs.ext4 /dev/sdb1

You can replace /dev/sdb1 with the appropriate partition if it differs for you. This command will create a new ext4 file system on the USB drive.

Create a Mount Point (if needed):

bash

sudo mkdir -p /media/yourusername/usbdrive

Mount the Drive:

bash

sudo mount /dev/sdb1 /media/yourusername/usbdrive

After these steps, your USB drive will be ready with the ext4 file system, which should be more stable and compatible with your Linux-based system.

If you occasionally need cross-platform compatibility with Windows or macOS, another alternative could be using exFAT, which is natively supported by Linux, Windows, and macOS.
You said:
I view Windows the same way I view racoons and possums and other creatures of the night, i.e. it does not come in the house....
ChatGPT said:
ChatGPT

Given your stance on Windows, formatting your USB drives as ext4 is an excellent choice. It will integrate seamlessly with your Linux environment and avoid the complexities associated with NTFS. You’ll gain all the benefits of using a native Linux file system without having to deal with any external Windows dependencies.

If you need any help with the formatting process or additional setup, feel free to ask!

Comments

Sort byBest