You are not logged in.
I noticed that (my?) Arch is corrupting every external storage device I plugin via any USB, and I can reproduce that behavior always, on both my desktop machine and my gf's laptop.
Those are the steps to reproduce it:
1. Reboot the machine. (to discard anything *weird*)
2. Plugin storage device (USB drive or SD card reader via USB).
3. Open gparted and format (ext2/3/4, ntfs, btrfs, it doesn't matter).
4. After the format is done, open the device with file explorer (dolphin, kde) and write a file (echo "foo bar" > test" is more than enough).
5. Run "sync" to make sure cache is cleaned, then extract safely the device via KDE's menu.
6. Plug-out and plugin again the device
7. An error message appears, saying that the device is corrupted and can't be mounted. (After a fsck, I can read the file again).
As I said, I have tried with my desktop machine and with my gf's laptop. Both machines use Arch 3.15.7-1, x64. The storage devices I have tried are 2 usb drives and 3 SD cards (pluged in via SD card reader via USB).
Also, I'm sure the storage devices work fine because after a few hours I decided to try with my mom's laptop (Windows 7 x64) and they all work fine.
What could be going on?
Offline
have u tried doing this via command-line? It SHOULD do the same.
-----------
lsblk
sudo fdisk /dev/sd?then o; n; e and w (most probably)
sudo mkfs.ext4 /dev/sd??This should set up ur USB-Stick with ext4 filessystem.
To mount:
sudo mount /dev/sd?? /media/MYUSBYes, I tried formatting the storage devices in all possible ways.
I also noticed that the first ~1024kb of the file get copied correctly to the drive, while the rest of the file gets corrupted and filled with null data.
Offline
hm have u tried sgdisk --zapp-all /dev/sd?
I just tried, the result is exactly the same. Any other ideas?
Offline
Did you run partprobe if you didn't reboot after recreating the partition(s)?
If you didn't reboot or run partprobe it just wiped out everything based on the old table, not the new repartitioned table.
Last edited by nomorewindows (2014-08-04 00:19:34)
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
@nomorewindows I don't see why that would matter as I'm formatting an external drive, but I tried it anyways, yet the same result.
I also tried the following:
1. Insert USB
2. sudo fdisk /dev/sd? , o, n, p, w
3. sudo mkfs.ntfs -f //dev/sd?1
4. sudo partprobe
5. mount USB drive in Dolphin (KDE's file explorer)
6. umount USB drive from Plasma's notification center
7. disconnect USB drive psychically.
8. connect USB drive psychically
9. try to mount USB drive with Dolphin <---- here I see this error:
The requested operation has failed: Error mounting /dev/sdb1 at /run/media/mj/7097C6E77888BBC9: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sdb1" "/run/media/mj/7097C6E77888BBC9"' exited with non-zero exit status 13: ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid argument ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid argument ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid argument ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid argument $MFTMirr does not match $MFT (record 0). Failed to mount '/dev/sdb1': Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's a SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is a SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper/ directory, (e.g. /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation for more details. If I try with ext4 I get a similar error message.
Offline
Anytime you change any partition table it has to be updated with the kernel. This was true even of DOS.
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
maybe I didnt told you corectly but I meant that u may need to do 'sgdisk --zapp-all /dev/sd?' inbetween 1. and 2. And pls post the output of every command.
Have you tried to format with fat - F 32?
Since you say you and your girlfriend get the same results, and those results include an error in KDE, I'm guessing you have (near-) identical setups. That makes it more difficult to diagnose without eliminating things. Start with high-level stuff: Turn off automounting in KDE. From the command line, format the drive using fdisk/cfdisk/gdisk, manually write a filesystem, and manually mount and unmount the drive. If that works, it's a KDE problem.
Offline
I made an entire session and I'm pasting it here so you can check what am I doing exactly.
[mj@stupidbox ~]$ sudo fdisk /dev/sdb
[sudo] password for mj:
Welcome to fdisk (util-linux 2.24.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): o
Created a new DOS disklabel with disk identifier 0x74d200d8.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-65535999, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-65535999, default 65535999):
Created a new partition 1 of type 'Linux' and of size 31.3 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[mj@stupidbox ~]$ sudo mkfs.ntfs -f /dev/sdb1
Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
mkntfs completed successfully. Have a nice day.
[mj@stupidbox ~]$ sudo mkdir /mnt/tmp_usb
[mj@stupidbox ~]$ sudo mount /dev/sdb1 /mnt/tmp_usb
[mj@stupidbox ~]$ cp /home/mj/tmp_files/file.avi /mnt/tmp_usb/
[mj@stupidbox ~]$ sync
[mj@stupidbox ~]$ sudo umount /mnt/tmp_usb
[sudo] password for mj:
[mj@stupidbox ~]$
[mj@stupidbox ~]$ <------------ at this point I extract the USB drive psychically
[mj@stupidbox ~]$
[mj@stupidbox ~]$ sudo mount /dev/sdb1 /mnt/tmp_usb
ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000 size: 1024 usa_ofs: 0 usa_count: 65535: Invalid argument
$MFTMirr does not match $MFT (record 0).
Failed to mount '/dev/sdb1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.
[mj@stupidbox ~]$ As I said earlier, this happens with other file systems too, but I insist with NTFS because that is what my gf needs right now.
Also, I get the exact same result with this exact same session replayed on my desktop machine.
@ANOKNUSA: Yes, you are right, my gf's laptop has almost 1:1 configuration as my machine.
KDE's automount is disabled on both machines.
Offline
1st isnt the syntax umount /dev/sd1 and not /mnt/tmp_usb ?
I recently glanced through some wiki-entries and I've found sth. which MAY help u out somehow -I dont quite understand them, but it could be related to that.
To mount removable drives, do not call mount from udev rules. In case of FUSE filesystems, you will get "Transport endpoint not connected" error. Instead use udisks that handles automount correctly.
https://wiki.archlinux.org/index.php/Udisks
Maybe there are some problems with auto-mounting (udisks is a cmd-tool, so it isnt directly related to KDE) ?
Lol, still, WHY NTFS -is it because of windows? windows can mount FAT, too -that's why I asked.
Sorry for the delay between each reply, I currently don't have access to internet.
@LeonardK I tried with `umount /dev/sdb1`, but I got the same result. The NTFS requirement is because she has +4GB files, so FAT is not an option. (and no, she can't split the files, but anyways, even if she could, that's not a solution to the main problem)
Any other ideas?
Offline
hm, then I'm really at the end of my wits. Hope some1 else can help u.