Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
2
answers
121
views
"File too large" when copying 8GB file onto 30GB Apple device (USB stick unlabeled)
I have this file on disk: ``` $ ls -lh /path/to/some.mkv -rwxr-xr-x 1 enrico enrico 7.4G Dec 17 18:54 /path/to/some.mkv ``` so it's less than 8 gigabytes, but when I try to copy it on a 30GiB flash drive, I get this error: ``` cp: error writing '/path/to/some.mkv': File too large ``` Here's the driv...
I have this file on disk:
$ ls -lh /path/to/some.mkv
-rwxr-xr-x 1 enrico enrico 7.4G Dec 17 18:54 /path/to/some.mkv
so it's less than 8 gigabytes, but when I try to copy it on a 30GiB flash drive, I get this error:
cp: error writing '/path/to/some.mkv': File too large
Here's the drive:
$ sudo fdisk -l | tail -n 16
Disk /dev/sdc: 29.3 GiB, 31457280000 bytes, 61440000 sectors
Disk model: USB DISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6f20736b
Device Boot Start End Sectors Size Id Type
/dev/sdc1 778135908 1919645538 1141509631 544.3G 72 unknown
/dev/sdc2 168689522 2104717761 1936028240 923.2G 65 Novell Netware 386
/dev/sdc3 1869881465 3805909656 1936028192 923.2G 79 unknown
/dev/sdc4 2885681152 2885736650 55499 27.1M d unknown
Partition table entries are not in disk order.
$ sudo mount /dev/sdc /mnt/foo
$ cd /mnt/foo
$ df . -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdc 30G 16K 30G 1% /mnt/foo
Enlico
(2258 rep)
Jan 3, 2025, 07:53 PM
• Last activity: Jan 6, 2025, 08:09 AM
0
votes
1
answers
123
views
How to format SD as FAT32 on mac?
On Mac, using Disk Utility, there is only the option to format a SD card to exFAT. I need to format it to FAT32 and probably try some older FAT file systems too. The card is microSDXC. Similar questions on the site only provided the answer for other operating systems.
On Mac, using Disk Utility, there is only the option to format a SD card to exFAT.
I need to format it to FAT32 and probably try some older FAT file systems too.
The card is microSDXC. Similar questions on the site only provided the answer for other operating systems.
Kamil
(49 rep)
Dec 31, 2024, 03:14 PM
• Last activity: Jan 2, 2025, 09:07 PM
1
votes
1
answers
194
views
/etc/fstab mounting with auto buffer flushing
My `/etc/fstab` line for the SD I'm willing to mount looks like: ``` /dev/mmcblk1 /media/sd_card vfat user,rw,umask=000,sync 0 2 ``` With this line I'm able to mount the SD, but everytime I want to unplug the SD I have to execute `blockdev --flushbufs /dev/mmcblk1` if I want to make the written chan...
My
/etc/fstab
line for the SD I'm willing to mount looks like:
/dev/mmcblk1 /media/sd_card vfat user,rw,umask=000,sync 0 2
With this line I'm able to mount the SD, but everytime I want to unplug the SD I have to execute blockdev --flushbufs /dev/mmcblk1
if I want to make the written changes take effect.
What means, that if I dont execute the blockdev
-command all the written changes are lost after unplugging the SD.
The weird thing is, that I all the time I was using this line, I thought everything is working fine...
So what am I doing wrong?
----------
I'm working on the jetson tx2 with Ubuntu 16.04 running on it.
JulianW
(143 rep)
Aug 22, 2019, 11:08 AM
• Last activity: Oct 19, 2024, 09:55 AM
0
votes
2
answers
539
views
How to fill FAT32 file system(linux) easily? My device drive is 32GB, in which 5 GB space will be taken for OS
I'm using 32GB device(linux based), which is using FAT32 filesystem, i want to test one thing that what would be the device behavior when i fill the device space with some random files. normally side loading the contents will take more than a day to fill the device. it would be better to create junk...
I'm using 32GB device(linux based), which is using FAT32 filesystem, i want to test one thing that what would be the device behavior when i fill the device space with some random files.
normally side loading the contents will take more than a day to fill the device.
it would be better to create junk files via shell script to fill the empty space. can anyone help me in this?
I don't want use the below commands. In my case i want create actual files.
fallocate -l 50G big_file
truncate -s 50G big_file
dd of=bigfile bs=1 seek=50G count=0
Santhosh
(153 rep)
Jun 4, 2018, 05:45 AM
• Last activity: Sep 14, 2024, 07:35 AM
44
votes
3
answers
5614
views
Why is the "ls" command showing permissions of files in a FAT32 partition?
I believe that the FAT32 file system does not support file permissions, however when I do `ls -l` on a FAT32 partition, `ls -l` shows that the files have permissions: -rw-r--r-- 1 john john 11 Mar 20 15:43 file1.txt -rw-r--r-- 1 john john 5 Mar 20 15:49 file2.txt Why is `ls -l` displaying the permis...
I believe that the FAT32 file system does not support file permissions, however when I do
ls -l
on a FAT32 partition, ls -l
shows that the files have permissions:
-rw-r--r-- 1 john john 11 Mar 20 15:43 file1.txt
-rw-r--r-- 1 john john 5 Mar 20 15:49 file2.txt
Why is ls -l
displaying the permissions of files?
user342731
(449 rep)
Mar 20, 2019, 01:52 PM
• Last activity: Nov 1, 2023, 06:30 AM
-1
votes
2
answers
2268
views
Ubuntu only allows FAT32 and not NTFS
I currently find myself in a desperate situation. I'm trying to boot from the pendrive on my computer installed with **Ubuntu 22.10**, it is not recognizing my pendrive formatted with the NTFS file system, which consequently makes it impossible to boot and format my computer. I've always formatted m...
I currently find myself in a desperate situation. I'm trying to boot from the pendrive on my computer installed with **Ubuntu 22.10**, it is not recognizing my pendrive formatted with the NTFS file system, which consequently makes it impossible to boot and format my computer.
I've always formatted my notebook with **NTFS** and it worked perfectly, but with this latest version of Ubuntu 22.10 I'm not having success. Currently my computer only recognizes the **FAT32** file system (I can usually format it in this format), but the problem is that I am trying to install **Windows 11 and a certain ISO file is 4.8 GB, i.e. , the file is broken with a file size limitation of 4GB** (the OS installation window will open but will not install because of this).
I honestly don't know what's going on, I've tried other file system formats, but Ubuntu is only releasing FAT32 and I can't install the operating system due to the file size limitation. Before someone tells me that the Pendrive is not configured correctly, Incorrect boot order in BIOS/UEFI, Corrupted boot image, Defective or damaged Pendrive, etc., I have already checked all of this, does anyone know of a solution?
leensc
(49 rep)
Sep 12, 2023, 03:42 PM
• Last activity: Sep 20, 2023, 07:45 PM
0
votes
0
answers
96
views
GParted fs check wiped disk - possible to undo?
I connected a fat32-formatted USB drive to my system. `dmesg` showed: ``` [ 4057.783200] sd 6:0:0:0: [sdd] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes) ... [ 4064.091218] FAT-fs (sdd1): Volume was not properly unmounted. Some data may be corrupt. Please run...
I connected a fat32-formatted USB drive to my system.
This time however it didn't just check the disk, it wiped it completely. Syslog tells me nothing:
dmesg
showed:
[ 4057.783200] sd 6:0:0:0: [sdd] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
...
[ 4064.091218] FAT-fs (sdd1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
The drive's used with MacOS, Win and Linux, hence fat32. This has happened a couple of times before as there's been short power cuts. As usual I used Gparted to check the disk, being too lazy to man fsck
to check out the options:

Mar 4 11:24:28 TREX kernel: [ 4053.248434] usb 2-3: new SuperSpeed Gen 1 USB device number 4 using xhci_hcd
Mar 4 11:24:28 TREX kernel: [ 4053.269705] usb 2-3: New USB device found, idVendor=0bc2, idProduct=231a, bcdDevice= 7.10
Mar 4 11:24:28 TREX kernel: [ 4053.269712] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 4 11:24:28 TREX kernel: [ 4053.269716] usb 2-3: Product: Expansion
Mar 4 11:24:28 TREX kernel: [ 4053.269719] usb 2-3: Manufacturer: Seagate
Mar 4 11:24:28 TREX kernel: [ 4053.269722] usb 2-3: SerialNumber: NAA9700F
Mar 4 11:24:28 TREX kernel: [ 4053.277694] scsi host6: uas
Mar 4 11:24:28 TREX kernel: [ 4053.278676] scsi 6:0:0:0: Direct-Access Seagate Expansion 0710 PQ: 0 ANSI: 6
Mar 4 11:24:28 TREX kernel: [ 4053.280001] sd 6:0:0:0: Attached scsi generic sg3 type 0
Mar 4 11:24:32 TREX kernel: [ 4057.782355] sd 6:0:0:0: [sdd] 3907029167 512-byte logical blocks: (2.00 TB/1.82 TiB)
Mar 4 11:24:32 TREX kernel: [ 4057.782361] sd 6:0:0:0: [sdd] 4096-byte physical blocks
Mar 4 11:24:32 TREX kernel: [ 4057.782547] sd 6:0:0:0: [sdd] Write Protect is off
Mar 4 11:24:32 TREX kernel: [ 4057.782552] sd 6:0:0:0: [sdd] Mode Sense: 53 00 00 08
Mar 4 11:24:32 TREX kernel: [ 4057.782880] sd 6:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Mar 4 11:24:32 TREX kernel: [ 4057.783200] sd 6:0:0:0: [sdd] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
Mar 4 11:24:33 TREX kernel: [ 4058.118689] sdd: sdd1
Mar 4 11:24:33 TREX kernel: [ 4058.142221] sd 6:0:0:0: [sdd] Attached SCSI disk
Mar 4 11:24:39 TREX kernel: [ 4064.091218] FAT-fs (sdd1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Mar 4 11:24:39 TREX udisksd: Mounted /dev/sdd1 at /media/pg1/E93B-1A8F on behalf of uid 1001
Mar 4 11:25:01 TREX CRON: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Mar 4 11:25:49 TREX systemd
: Reloading.
Mar 4 11:25:49 TREX kernel: [ 4134.948332] SGI XFS with ACLs, security attributes, realtime, quota, no debug enabled
Mar 4 11:26:05 TREX systemd
: Reloading.
Mar 4 11:26:35 TREX systemd
: Reloading.
Mar 4 11:26:55 TREX udisksd: Cleaning up mount point /media/pg1/E93B-1A8F (device 8:49 is not mounted)
Mar 4 11:26:55 TREX systemd: media-pg1-E93B\x2d1A8F.mount: Succeeded.
Mar 4 11:26:55 TREX systemd
: media-pg1-E93B\x2d1A8F.mount: Succeeded.
/var/log/messages
and journald
aren't any more helpful. The disk itself is fine, it's just empty instead of containing the data I've stored there.
The disk is unmounted. Is there any way to recover the data?
Command sudo systemctl cat media-pg1-E93B\x2d1A8F.mount
reports No files found for media-pg1-E93Bx2d1A8F.mount.
I remounted the disk and rerun the command, but it returned nothing. Syslog after remounting:
Mar 4 19:23:50 TREX kernel: [32814.682162] usb 2-3: new SuperSpeed Gen 1 USB device number 5 using xh>
Mar 4 19:23:50 TREX kernel: [32814.703495] usb 2-3: New USB device found, idVendor=0bc2, idProduct=23>
Mar 4 19:23:50 TREX kernel: [32814.703502] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialN>
Mar 4 19:23:50 TREX kernel: [32814.703506] usb 2-3: Product: Expansion
Mar 4 19:23:50 TREX kernel: [32814.703509] usb 2-3: Manufacturer: Seagate
Mar 4 19:23:50 TREX kernel: [32814.703512] usb 2-3: SerialNumber: NAA9700F
Mar 4 19:23:50 TREX kernel: [32814.713388] scsi host6: uas
Mar 4 19:23:50 TREX kernel: [32814.714278] scsi 6:0:0:0: Direct-Access Seagate Expansion >
Mar 4 19:23:50 TREX kernel: [32814.715560] sd 6:0:0:0: Attached scsi generic sg3 type 0
Mar 4 19:23:54 TREX kernel: [32819.079622] sd 6:0:0:0: [sdd] 3907029167 512-byte logical blocks: (2.0>
Mar 4 19:23:54 TREX kernel: [32819.079628] sd 6:0:0:0: [sdd] 4096-byte physical blocks
Mar 4 19:23:54 TREX kernel: [32819.079849] sd 6:0:0:0: [sdd] Write Protect is off
Mar 4 19:23:54 TREX kernel: [32819.079855] sd 6:0:0:0: [sdd] Mode Sense: 53 00 00 08
Mar 4 19:23:54 TREX kernel: [32819.080229] sd 6:0:0:0: [sdd] Write cache: enabled, read cache: enable>
Mar 4 19:23:54 TREX kernel: [32819.080516] sd 6:0:0:0: [sdd] Optimal transfer size 33553920 bytes not>
Mar 4 19:23:54 TREX kernel: [32819.416147] sdd: sdd1
Mar 4 19:23:54 TREX kernel: [32819.455923] sd 6:0:0:0: [sdd] Attached SCSI disk
pg1@TREX:~$ sudo systemctl cat media-pg1-E93B\x2d1A8F.mount
No files found for media-pg1-E93Bx2d1A8F.mount.
pg1@TREX:~$ sudo systemctl cat media-pg1-E93B\\x2d1A8F.mount
No files found for media-pg1-E93B\x2d1A8F.mount.
Peregrino69
(2515 rep)
Mar 4, 2023, 09:49 AM
• Last activity: Mar 4, 2023, 05:43 PM
0
votes
2
answers
2412
views
FAT32 / NTFS + isofs on USB flash drive
I have a bootable USB stick as shown in the screenshot: # dd if=/path/to/os_image.iso of=/dev/sdb (...everything OK...) # sudo dumpe2fs /dev/sdb dumpe2fs 1.42.9 (4-Feb-2014) dumpe2fs: Bad magic number in super-block while trying to open /dev/sdb Couldn't find valid filesystem superblock. GParted doe...
I have a bootable USB stick as shown in the screenshot:
# dd if=/path/to/os_image.iso of=/dev/sdb
(...everything OK...)
# sudo dumpe2fs /dev/sdb
dumpe2fs 1.42.9 (4-Feb-2014)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sdb
Couldn't find valid filesystem superblock.
GParted doesn't recognize any partitions.
The GUI file manager reports the filesystem as

isofs
. The system boots and everything works fine.
The problem is, I want to use the USB stick for a live OS _and_ as a storage with PCs and TVs which only recognize FAT32 and NTFS.
I have tried creating two partitions, doing dd
on sdb1
and making sdb1
the only bootable partition, but the system didn't boot.
How to put both FAT32/NTFS and (any) bootable ISO image on an MBR-partitioned disk without using an external bootable USB creator program? I would like to simply use dd
, as I do now.
Presumably this could be solved using the right bootloader with the right configuration. I just don't know which bootloader and what configuration.
kyrill
(154 rep)
Jul 5, 2016, 02:10 PM
• Last activity: Feb 11, 2023, 06:51 PM
5
votes
2
answers
967
views
Can I install GNU/Linux on a FAT drive?
Out of curiosity, is this possible nowadays? I remember some old Slackware versions did support FAT root partition but I am not sure if this is possible with modern kernels and if there are any distros offering such an option. I am interested in pure DOS FAT (without long names support), VFAT 16/32...
Out of curiosity, is this possible nowadays? I remember some old Slackware versions did support FAT root partition but I am not sure if this is possible with modern kernels and if there are any distros offering such an option. I am interested in pure DOS FAT (without long names support), VFAT 16/32 and exFAT.
PS: Don't tell me I shouldn't, I am not going to use this in production unless necessary :-)
Ivan
(18358 rep)
Dec 8, 2015, 07:13 PM
• Last activity: Sep 3, 2022, 08:22 AM
1
votes
0
answers
642
views
How to debug why uid,gid,umask,fmask and dmask mount options are ignored?
I am running a Live ISO of Kubuntu 22.04 LTS (AKA Jammy Jellyfish). What I am trying to do has most likely nothing to do with KDE, so one may assume I am running Ubuntu. I am trying to mount a `FAT32` partition in read-write mode for current user. On this Live ISO the user is called `kubuntu` (it is...
I am running a Live ISO of Kubuntu 22.04 LTS (AKA Jammy Jellyfish). What I am trying to do has most likely nothing to do with KDE, so one may assume I am running Ubuntu.
I am trying to mount a
FAT32
partition in read-write mode for current user. On this Live ISO the user is called kubuntu
(it is ubuntu
in case of Ubuntu). There is also a root
which always has all permissions, obviously. But I want to make it work for a regular user.
Lets assume I have the partition device path in shell variable P
and mount point path in MP
. I tried to execute such command
sudo mount $P $MP
Then when I call
mount | grep $MP
I can see such mount type and options applied (please note fmask
and dmask
options values):
type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
When I call stat $MP | grep Uid:
I get this:
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
It completely matches to what one would expect when doing mount as root
when options with values like fmask=0022,dmask=0022
have been applied.
I tried to find an information about how to make mounted FS work for a regular user. All the recommendations are about uid
,gid
,umask
,fmask
, dmask
and how to use those. While I am pretty happy with fmask=0022,dmask=0022
I also decided to try to reset those as well. So I ended up trying this (added redundancy, just in case):
sudo mount -o uid=$(id -u),gid=$(id -g),umask=0000,fmask=0000,dmask=0000 $P $MP
And guess what? The result is exactly the same as I mentioned above. It is
type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
Same thing with stat $MP | grep Uid:
. It returns
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
There are no write permissions for my kubuntu
user.
I checked sudo dmesg | tail -n 2
and cat /var/log/syslog | tail -n 2
. I usually triggering "sysrq: Emergency Sync" by pressing Alt+(SysRq/PrtScr, S)
right before I do something like above (sudo mount ...
). This way I have a "checkpoint" in logs which consist of 2 lines with text fragments sysrq: Emergency Sync
and Emergency Sync complete
. So as usual I triggered "sysrq: Emergency Sync" and then called sudo mount ...
. After checking both logs all I saw was just those 2 lines related to "sysrq: Emergency Sync". There is nothing related to mount
command which would shed some light on why it ignored mount options.
So here are the questions:
- Why the mount options I provided were ignored?
- How to troubleshoot this kind of mount
behavior?
Victor Yarema
(148 rep)
Jul 20, 2022, 12:27 PM
• Last activity: Jul 20, 2022, 12:33 PM
5
votes
1
answers
8656
views
Cannot format my EFI partition (FAT32)
When formatting my EFI partition I get this error: Not enough clusters for a 32 bit FAT!" My disk use 4096 sector size. #mkfs.fat -v -F 32 -S 4096 /dev/sde1 mkfs.fat 4.1 (2017-01-24) WARNING: Not enough clusters for a 32 bit FAT! /dev/sde1 has 255 heads and 63 sectors per track, hidden sectors 0x400...
When formatting my EFI partition I get this error:
Not enough clusters for a 32 bit FAT!"
My disk use 4096 sector size.
#mkfs.fat -v -F 32 -S 4096 /dev/sde1
mkfs.fat 4.1 (2017-01-24)
WARNING: Not enough clusters for a 32 bit FAT!
/dev/sde1 has 255 heads and 63 sectors per track,
hidden sectors 0x4000;
logical sector size is 4096,
using 0xf8 media descriptor, with 67584 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 16 sectors, and provides 8440 clusters.
There are 32 reserved sectors.
Volume ID is 05deb9f7, no volume label.
My disk partition:
gdisk -l /dev/sde
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sde: 244190646 sectors, 931.5 GiB
Logical sector size: 4096 bytes
Disk identifier (GUID): D0BA102E-86C5-4379-B314-9534F873C377
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 244190640
Partitions will be aligned on 256-sector boundaries
Total free space is 244123051 sectors (931.3 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 69631 264.0 MiB 0700 EFI_FAT32
**fsck.fat** give the following:
#fsck.fat -v /dev/sde1
fsck.fat 4.1 (2017-01-24)
Checking we can access the last sector of the filesystem
Warning: Filesystem is FAT32 according to fat_length and fat32_length fields,
but has only 8440 clusters, less than the required minimum of 65525.
This may lead to problems on some systems.
Boot sector contents:
System ID "mkfs.fat"
Media byte 0xf8 (hard disk)
4096 bytes per logical sector
32768 bytes per cluster
32 reserved sectors
First FAT starts at byte 131072 (sector 32)
2 FATs, 32 bit entries
65536 bytes per FAT (= 16 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 262144 (sector 64)
8440 data clusters (276561920 bytes)
63 sectors/track, 255 heads
16384 hidden sectors
67584 sectors total
Checking for unused clusters.
Checking free cluster summary.
/dev/sde1: 1 files, 1/8440 clusters
BMWW
(155 rep)
Apr 30, 2018, 07:51 PM
• Last activity: May 21, 2022, 11:50 AM
0
votes
1
answers
2642
views
Why am I not able to load files from a partition with U-Boot?
For some reason, my U-Boot does not seem to be able to load files from my FAT32 partition: => mmc part Partition Map for MMC device 1 -- Partition Type: DOS Part Start Sector Num Sectors UUID Type 1 2048 62519296 a1d1165e-01 0b => fatls mmc 1:1 52560 file1.bin 1984 file2.bin 456 file3.bin 64 file4.b...
For some reason, my U-Boot does not seem to be able to load files from my FAT32 partition:
=> mmc part
Partition Map for MMC device 1 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 2048 62519296 a1d1165e-01 0b
=> fatls mmc 1:1
52560 file1.bin
1984 file2.bin
456 file3.bin
64 file4.bin
=> fatload mmc 1:1 0x0001FF80 file1.bin
** Reading file would overwrite reserved memory **
Failed to load 'file1.bin'
Why do I get
Failed to load
and how can I get around it?
MisdeBug
(43 rep)
Mar 4, 2022, 01:30 AM
• Last activity: Mar 4, 2022, 05:47 PM
2
votes
1
answers
6136
views
Error: "failed to preserve ownership" when trying to move files to a FAT32 partition on OpenBSD
I'm following a tutorial on how to install firmware on OpenBSD. The tutorial has me creating a new msdos file system on the usb with: `newfs_msdos -F 32 /dev/rsd2c` then to take usb to a system with an internet connection, then move the firmware tarball into the USB. I have never moved data to a msd...
I'm following a tutorial on how to install firmware on OpenBSD. The tutorial has me creating a new msdos file system on the usb with:
newfs_msdos -F 32 /dev/rsd2c
then to take usb to a system with an internet connection, then move the firmware tarball into the USB. I have never moved data to a msdos fs via the command line before. The tutorial shows him using dolphin on a manajaro install, however I do not have any systems with gui's installed.
How can I move the tarball to the usb drive?
I've tried mounting it them moving to the mounted directory but it does not work.
Stating failed to preserve ownership for '/mnt2/iwn-firmwae.tgz': Operation not permitted
Here's a link to the tutorial: https://www.youtube.com/watch?v=kUrUq2qfWiY
Rawley Fowler
(283 rep)
Dec 23, 2021, 11:27 PM
• Last activity: Dec 24, 2021, 01:30 AM
11
votes
4
answers
8029
views
Contiguous copy – How do I copy files contiguously?
I want to copy a number of files onto a flash drive such that each individual file is contiguous. They do not need to be contiguous with each other, and can be in any order. The files will be very large – hundreds of megabytes, to gigabytes. No other files on the drive should be defragmented; doing...
I want to copy a number of files onto a flash drive such that each individual file is contiguous. They do not need to be contiguous with each other, and can be in any order. The files will be very large – hundreds of megabytes, to gigabytes. No other files on the drive should be defragmented; doing so would waste time and cause unnecessary wear on the flash media.
I want to be able to do this for at least FAT32, but methods for
*nix
filesystems will also be appreciated.
Essentially, there are 2 approaches to this:
* Copy then defragment the files.
* Defrag enough contiguous free space for each file, then copy each file into its place.
The 2nd option would generally be far quicker than the 1st, and would avoid causing unnecessary wear on the flash media, so the 2nd option would be very much preferable.
I don't mind solutions that work offline, but obviously online is preferable.
James Haigh
(739 rep)
Jun 20, 2013, 02:24 AM
• Last activity: Jun 11, 2021, 04:17 AM
2
votes
3
answers
11977
views
Get contents of ddrescue image file
I have a failed harddrive with around 400 GB of data, of which approximately 50 GB need to be recovered. All the data is located in a specific directory (*/Fotos2018/*). The hard drive is a [WD My Passport Essential WDBAAA5000ABK (500 GB, USB 2.0)][1]. It contained a FAT32 partition containing my da...
I have a failed harddrive with around 400 GB of data, of which approximately 50 GB need to be recovered. All the data is located in a specific directory (*/Fotos2018/*).
The hard drive is a WD My Passport Essential WDBAAA5000ABK (500 GB, USB 2.0) . It contained a FAT32 partition containing my data, as well as another partition containing some WD software.
I attempted to back up my data to a healthy hard drive, using
ddrescue --no-split -r3 /dev/sdb1 defekt_wd.iso defekt_wd.log
. It generated tons of errors (I don't have the output), but ended up with the output file. The log file is 1.2 MB if that gives any indication.
During this operation, the hard drive sounded increasingly scratchy, and became rather hot.
I have found various methods to extract the contents, but none of them were succesful. Below are my attempts:
First, traditional mounting (however, I cannot recompile the kernel on the current machine due to the warranty terms, but if you believe this would work on a different machine, I can copy the image file)
# mount defekt_wd.img /tmp/defektdisk
mount: Could not find any loop device. Maybe this kernel does not know about the loop device? (If so, recompile or `modprobe loop'.)
# modprobe loop
FATAL: Module loop not found.
Second, using xorriso.
# xorriso -indev defekt_wd.img -ls
xorriso 1.3.2 : RockRidge filesystem manipulator, libburnia project.
xorriso : NOTE : Loading ISO image tree from LBA 0
libisoburn: WARNING : No ISO 9660 image at LBA 0. Creating blank image.
Drive current: -indev 'defekt_wd.img'
Media current: stdio file, overwriteable
Media status : is written , is closed
Media summary: 1 session, 228724832 data blocks, 436g data, 0 free
Volume id : 'ISOIMAGE'
Valid ISO nodes found: 0
I have also tried to extract/list/test the archive using 7-zip, e.g.:
# 7z l defekt_wd.img
7-Zip 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=C,Utf16=off,HugeFiles=on,2 CPUs)
Error: defekt_wd.img: Can not open file as archive
Errors: 1
Here's the output of file
:
# file defekt_wd.img
defekt_wd.img: x86 boot sector, code offset 0x58, OEM-ID "BSD 4.4", sectors/cluster 64, Media descriptor 0xf8, heads 255, hidden sectors 2048, sectors 975394816 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 119038, reserved3 0x800000, serial number 0xac2710e2, label: "XYZ "
My current theory is that the image file contains two partitions, but I do not know how to extract the contents of just one of them.
Can you offer any suggestions on what to do next?
Kristian
(699 rep)
Oct 4, 2018, 09:18 PM
• Last activity: May 27, 2021, 01:33 PM
2
votes
1
answers
2517
views
FAT32 - Unallocated space within partition
I have an SD card with 3 partitions: FAT32, EXT4 and swap. I shrank and moved them recently, but due to a bug in GParted (segfault while resizing FAT32) it is left like this: **Size**: 5.87 GiB **Used**: 623 MiB **Unused**: 4.37 GiB **Unallocated**: 915 MiB GParted suggests me to repair the partitio...
I have an SD card with 3 partitions: FAT32, EXT4 and swap. I shrank and moved them recently, but due to a bug in GParted (segfault while resizing FAT32) it is left like this:
**Size**: 5.87 GiB
**Used**: 623 MiB
**Unused**: 4.37 GiB
**Unallocated**: 915 MiB
GParted suggests me to repair the partition with Partition -> Check, but there's that bug. Any other tools which can do the same thing - expand fat32 size to the same as in the partition table? I tried
dosfsck/fsck.vfat
and MS chkdsk
, none of them helped.
pfoof
(23 rep)
May 15, 2016, 02:25 PM
• Last activity: Apr 14, 2021, 12:32 PM
7
votes
5
answers
21323
views
How to deal with characters like ":" or "?" that make invalid filenames?
I just tried to move a directory containing music files with `thunar 4.10` It complained that a file name was invalid. It turned out that one file name (song title) contained a question mark. I suspected that this was a problem, removed the question mark and could indeed copy the file. Adding the "?...
I just tried to move a directory containing music files with
thunar 4.10
It complained that a file name was invalid.
It turned out that one file name (song title) contained a question mark.
I suspected that this was a problem, removed the question mark and could indeed copy the file.
Adding the "?" back in was not possible. I also tried it with rename
on the command line but that didn't work either. (not sure what thunar uses under the hood, so this test might be moot)
Now if a question mark makes the file name invalid, how could this file be created in the first place? I created the files with SoundJuicer
from a newly obtained CD. I was able to play the file (with "?" in the name) in various players.
What's going on here? Can I have the "?" in the name or not? Why is the file manager unable to handle such files while other applications seem to be ok with it?
**Update:**
Next song has a ":" in it. Same problem as with the "?".
> These are not invalid characters to Unix; typically only the NUL character and the / character are invalid filenames (the / being the directory separator).
This was what my intuition told me as well, because I never had any issues with file names in Linux and could throw pretty much everything sensible at it and it worked ok. This is what motivated the question here. I never encountered invalid file names before.
> Were you trying to move the files to a USB stick? If so, is that stick formatted as FAT32 or as a native Linux filesystem?
The target is indeed a USB stick that I bought today. I opened gparted
and it is formatted as FAT32.
I'm not exactly sure but that's a Windows thing right? And Windows has a bunch of characters that it doesn't support, apaprently including ?
and :
. Am I right?
null
(195 rep)
Aug 1, 2016, 05:28 PM
• Last activity: Mar 10, 2021, 11:00 AM
1
votes
1
answers
237
views
Plugged USB stick into macbook and all data was wiped
I plugged a 32GB usb stick into a 2019 macbook pro and all data was automatically and immediately removed. OSX shows no data on the stick. There used to be data on the stick. I went back to my linux box and checked. Sure enough, OSX had done something to the filesystem so it was empty and then it cr...
I plugged a 32GB usb stick into a 2019 macbook pro and all data was automatically and immediately removed. OSX shows no data on the stick. There used to be data on the stick.
I went back to my linux box and checked. Sure enough, OSX had done something to the filesystem so it was empty and then it created the normal hidden files (.fseventsd, .Spotlight-V100).
On linux, I started a file recovery tool to get my data back and that worked fine but I lost the file names.
What I'd like to know is wtf did OSX do to my drive and how to reverse it? This also happened once before a long time ago with a 1TB ntfs external hdd that I forgot about so I'm sure this is a common problem.
Here is the flashdrive filsystem info after OSX changed it:
>sudo file -s /dev/sdh /dev/sdh: DOS/MBR boot sector MS-MBR XP english at offset 0x12c "Invalid partition table" at offset 0x144 "Error loading operating system" at offset 0x163 "Missing operating system", disk signature 0x6f55f075; partition 1 : ID=0xc, start-CHS (0x0,63,1), end-CHS (0x270,96,1), startsector 8064, 60559488 sectors FAT32
Before, it was probably something like this (different usb flashdrive):
>sudo file -s /dev/sdh /dev/sdi: DOS/MBR boot sector; partition 1 : ID=0xb, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 2, 121065982 sectors, extended partition table (last) FAT32 (LBA)
Looks like the filesystems are slightly different now.
Does anyone know if there is a simple fsck command I can run to just repair the filesystem on the stick (and get the file names/dir structure back)? I know all the data is still there after running a recovery util. I'm not too familiar with filesystem implementation details.
**Edit**: I tried to reproduce this by repartitioning+reformatting the stick with fdisk (extended 0xb and norm 0xc) and mkfs.vfat but no luck. I did manage to reproduce it when using mkfs.ntfs (mkntfs v2015.3.14AR.1 (libntfs-3g)). Maybe the flashdrive was formatted with ntfs? It was so long ago I can't be sure.
At least with that all I can say is DON'T PLUG A NTFS STICK INTO A MAC!
I'm happy to get more details if you need.
extracrispy
(111 rep)
Feb 13, 2021, 01:41 AM
• Last activity: Feb 15, 2021, 05:24 PM
2
votes
2
answers
2097
views
Why grub for efi is still installed on fat32?
Isn't fat32 a deprecated filesystem format? Why does grub for efi booting is still required to be installed on a fat32 partition?
Isn't fat32 a deprecated filesystem format?
Why does grub for efi booting is still required to be installed on a fat32 partition?
User
(254 rep)
Feb 10, 2021, 07:18 AM
• Last activity: Feb 10, 2021, 08:09 AM
0
votes
1
answers
578
views
How to get syslinux to install to fat32 backup boot sector
How do you get syslinux to install to fat32, and have it write the backup boot sector. It only writes to the main boot sector, and then fsck.fat complains. You can get fsck.fat to fix it, but this requires running it in interactive mode, and hence is not possible from a script. ``` /tmp # fallocate...
How do you get syslinux to install to fat32, and have it write the backup boot sector. It only writes to the main boot sector, and then fsck.fat complains. You can get fsck.fat to fix it, but this requires running it in interactive mode, and hence is not possible from a script.
/tmp # fallocate -l 50m test_image
/tmp # mkfs.fat -F32 test_image
mkfs.fat 4.1 (2017-01-24)
/tmp # syslinux --directory syslinux --install test_image
/tmp # fsck.vfat test -a
fsck.fat 4.1 (2017-01-24)
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
3:53/6d, 4:59/6b, 5:53/66, 6:4c/73, 7:49/2e, 8:4e/66, 9:55/61, 10:58/74
, 90:fa/0e, 91:fc/1f, 92:31/be, 93:c9/77, 94:8e/7c, 95:d1/ac, 96:bc/22
, 97:76/c0, 98:7b/74, 99:52/0b, 100:06/56, 101:57/b4, 102:1e/0e, 103:56/bb
, 104:8e/07, 105:c1/00, 106:b1/cd, 107:26/10, 108:bf/5e, 109:78/eb
------------ SNIP ---------------------------------------------------------
, 484:0d/00, 485:0a/00, 504:fe/00, 505:02/00, 506:b2/00, 507:3e/00
, 508:18/00, 509:37/00
Not automatically fixing this.
test: 2 files, 353/100792 clusters
Gary van der Merwe
(1830 rep)
Aug 9, 2020, 03:21 PM
• Last activity: Aug 10, 2020, 09:09 AM
Showing page 1 of 20 total questions