Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
2 answers
3000 views
New SSD USB drive: fdisk doesn't change partitions and mkfs doesn't change format
I have this portable SSD drive that I am trying to format for use with my Raspberry Pi 3: https://www.amazon.com/gp/product/B00N0V4JG2 In the past I have used this exact product, but the 128GB version, formatted as FAT32 on my OSX machine, and the drive worked with no issues on the Pi. I'm using it...
I have this portable SSD drive that I am trying to format for use with my Raspberry Pi 3: https://www.amazon.com/gp/product/B00N0V4JG2 In the past I have used this exact product, but the 128GB version, formatted as FAT32 on my OSX machine, and the drive worked with no issues on the Pi. I'm using it store the Bitcoin blockchain. Now that the blockchain is too big I'm trying to replace the drive with a 512GB drive, and I am having no luck getting this thing to work! I first tried the OSX FAT32 format, but that didn't work. So I'm trying to format it with the Pi itself. Starting off with fdisk /dev/sda as sudo su with USB drive unmounted: /dev/sda1 2 1000215215 1000215214 477G b W95 FAT32 Then I go through the process of [d]elete, [n]ew, [w]rite: /dev/sda1 2048 1000215215 1000213168 477G 83 Linux but even after a partprobe AND a reboot, fdisk -l still reports no change: /dev/sda1 2 1000215215 1000215214 477G b W95 FAT32 ... am I doing anything wrong up to this point? I also went forward with mfks.ext4 /dev/sda1 and still don't see anything changing (I can post those logs too...) And when I run fsck it is a TOTAL BLOODBATH -- which is even more confusing! How can a freshly formatted, brand new file-system have so many errors? Stuff like this (selected examples out of hundreds): Inode 138789 has a extra size (30700) which is invalid Inode 138825 has a bad extended attribute block 17929510. Inode 138877 has compression flag set on filesystem without compression support. Inode 139153 has a extra size (6956) which is invalid Finally, when I attach the drive my OSX machine I can format it and use it and it works FINE. So I think the drive is not defective.
pinhead (73 rep)
Jan 17, 2017, 06:59 PM • Last activity: Jul 10, 2025, 12:05 AM
4 votes
3 answers
497 views
Can’t see partition device after creating GPT partition on 6TB disk
I have a 6TB disk in Debian Linux 12, let's say the disk is `/dev/sdd`. It's just for data; no parts of the OS are on it. Now I’m trying to use it as a normal disk with the full space in a single partition. If I try to create the partition, `fdisk` tells me that the max size with a DOS partition is...
I have a 6TB disk in Debian Linux 12, let's say the disk is /dev/sdd. It's just for data; no parts of the OS are on it. Now I’m trying to use it as a normal disk with the full space in a single partition. If I try to create the partition, fdisk tells me that the max size with a DOS partition is 2TB. If I create that, I get a new device /dev/sdd1, but the size is limited to 2TB, not what I want. To have a single 6TB partition, I need to use a GPT partition table instead of DOS. If I do that, I can create a single partition with fdisk. But then I don’t get a device node for the partition (/dev/sdd1), which I need later for things like formatting. Any ideas? **EDIT** I create the partition that way. fdisk /dev/sdd Tells me then: *The size of this disk is 6 TiB (6597069766656 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).* Commands are then: g n w That creates a GPT partition table and a new partition with full size and writes it down.
chris01 (869 rep)
Jun 27, 2025, 08:42 AM • Last activity: Jun 27, 2025, 01:04 PM
14 votes
3 answers
3325 views
Difference between mkfs -t ext4 and mkfs.ext4
Is there a difference between `sudo mkfs -t ext4 /dev/sdb` and `sudo mkfs.ext4 /dev/sdb`? Or is the latter just an alias of the former?
Is there a difference between sudo mkfs -t ext4 /dev/sdb and sudo mkfs.ext4 /dev/sdb? Or is the latter just an alias of the former?
muggi (759 rep)
Apr 27, 2023, 04:33 PM • Last activity: Mar 25, 2025, 01:24 AM
1 votes
0 answers
1013 views
How do I get ext3/ext4 filesystem features to apply in mke2fs?
As many of you know, `ext3/ext4` have filesystem features that provide their special functionalities. Some of these features can be retrieved using `dumpe2fs`, for example, this output: **Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_s...
As many of you know, ext3/ext4 have filesystem features that provide their special functionalities. Some of these features can be retrieved using dumpe2fs, for example, this output: **Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize** So my question is, where in the system or which command can I use to get the full listing of filesystem features to apply when using mke2fs? If anyone happens to know a useful website/link I'd appreciate it too.
strkIV (56 rep)
May 8, 2017, 08:22 PM • Last activity: Mar 17, 2025, 08:32 AM
8 votes
3 answers
16365 views
How do you make filesystems in mac OSX
How do you make filesystems in OSX? Mac OSX doesn't have the `mkfs` command.
How do you make filesystems in OSX? Mac OSX doesn't have the mkfs command.
John Militer (813 rep)
Mar 23, 2016, 11:56 PM • Last activity: Jan 28, 2025, 03:08 AM
4 votes
2 answers
892 views
mkfs.ext4 to loop: 128-byte inodes cannot handle dates beyond 2038 and are deprecated
When I use `mkfs.ext4` to `/dev/loop18` I get this warning: > 128-byte inodes cannot handle dates beyond 2038 and are deprecated Code: ```sh echo y | mkfs.ext4 /dev/loop18 ``` Result: ```sh mke2fs 1.47.1 (20-May-2024) 128-byte inodes cannot handle dates beyond 2038 and are deprecated 64-bit filesyst...
When I use mkfs.ext4 to /dev/loop18 I get this warning: > 128-byte inodes cannot handle dates beyond 2038 and are deprecated Code:
echo y | mkfs.ext4 /dev/loop18
Result:
mke2fs 1.47.1 (20-May-2024)
128-byte inodes cannot handle dates beyond 2038 and are deprecated
64-bit filesystem support is not enabled.  The larger fields afforded by this feature enable full-strength checksumming.  Pass -O 64bit to rectify.
Discarding device blocks: done                            
Creating filesystem with 5140 1k blocks and 1288 inodes

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done
__/etc/mke2fs.conf__
[defaults]
	base_features = sparse_super,large_file,filetype,resize_inode,dir_index,ext_attr
	default_mntopts = acl,user_xattr
	enable_periodic_fsck = 0
	blocksize = 4096
	inode_size = 256
	inode_ratio = 16384

[fs_types]
	ext3 = {
		features = has_journal
	}
	ext4 = {
		features = has_journal,extent,huge_file,flex_bg,metadata_csum,dir_nlink,extra_isize
		inode_size = 256
		auto_64-bit_support = 1
	}
	small = {
		blocksize = 1024
		inode_size = 128
		inode_ratio = 4096
	}
	floppy = {
		blocksize = 1024
		inode_size = 128
		inode_ratio = 8192
	}
	big = {
		inode_ratio = 32768
	}
	huge = {
		inode_ratio = 65536
	}
	news = {
		inode_ratio = 4096
	}
	largefile = {
		inode_ratio = 1048576
		blocksize = -1
	}
	largefile4 = {
		inode_ratio = 4194304
		blocksize = -1
	}
	hurd = {
	     blocksize = 4096
	     inode_size = 128
	}
What is the way to use it without that warning appearing?
ArtEze (137 rep)
Jan 23, 2025, 03:40 PM • Last activity: Jan 25, 2025, 08:31 AM
7 votes
1 answers
17753 views
Formatting an SD card with mkfs hangs indefinitely
I am trying to format an SD card following [this](https://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2#installation) guide. I am able to successfully create the partition table, but attempting to format the Linux partition with `mkfs` yields the following output: mke2fs 1.42.9 (4-Feb-201...
I am trying to format an SD card following [this](https://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2#installation) guide. I am able to successfully create the partition table, but attempting to format the Linux partition with mkfs yields the following output: mke2fs 1.42.9 (4-Feb-2014) Discarding device blocks: 4096/1900544 where it appears to hang indefinitely. I have left the process running for a while but nothing changes. If I eject the SD card then mkfs writes the expected output to the terminal: mke2fs 1.42.9 (4-Feb-2014) Discarding device blocks: failed - Input/output error Warning: could not erase sector 2: Attempt to write block to filesystem resulted in short write warning: 512 blocks unused. Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 476064 inodes, 1900544 blocks 95026 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=1946157056 58 block groups 32768 blocks per group, 32768 fragments per group 8208 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Allocating group tables: done Warning: could not read block 0: Attempt to read block from filesystem resulted in short read Warning: could not erase sector 0: Attempt to write block to filesystem resulted in short write Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: 0/58 Warning, had trouble writing out superblocks. Why is mkfs reporting that we are "discarding" blocks and what might be causing the hangup? --------------- **EDIT** I am able to successfully create two partitions -- one at 100MB and the other 7.3GB. I then can format, and mount, the 100MB partition as FAT32 -- it's the ext4 7.3GB partition that is having this trouble. dmesg is flooded with: [ 9350.097112] mmc0: Got data interrupt 0x02000000 even though no data operation was in progress. [ 9360.122946] mmc0: Timeout waiting for hardware interrupt. [ 9360.125083] mmc_erase: erase error -110, status 0x0 [ 9360.125086] end_request: I/O error, dev mmcblk0, sector 3096576 **EDIT 2** It appears the problem manifests when I am attempting to format as ext4. If I format the 7.3GB partition as FAT32, as an example, the operation succeeds. **EDIT 2** To interestingly conclude the above, I inserted the SD card into a BeagleBone and formatted it in the exact same way I was on Mint and everything worked flawlessly. I removed the SD card, reinserted it into my main machine and finished copying over the data to the newly created and formatted partitions.
sherrellbc (2601 rep)
Jan 11, 2016, 05:47 PM • Last activity: Jan 19, 2025, 01:21 AM
20 votes
1 answers
64610 views
How can I format a partition into a filesystem quickly?
In gparted, repartitioning a disk into one single partition and formatting the partition to a filesystem is very fast. It seems not write zeros to the partition. How can I achieve the same when using commands? Here is what I got: $ sudo mkfs -t ntfs /dev/sdb1 Cluster size has been automatically set...
In gparted, repartitioning a disk into one single partition and formatting the partition to a filesystem is very fast. It seems not write zeros to the partition. How can I achieve the same when using commands? Here is what I got: $ sudo mkfs -t ntfs /dev/sdb1 Cluster size has been automatically set to 4096 bytes. Initializing device with zeroes: 14% 16%
Tim (106420 rep)
Feb 27, 2019, 12:20 PM • Last activity: Oct 31, 2024, 08:17 PM
14 votes
4 answers
67298 views
mkfs.ext4 command not found in Debian (Jessie)
I have just installed Debian 8.4 (Jessie, MATE desktop). For some reason the following command is not recognized: mkfs.ext4 -L hdd_misha /dev/sdb1 The error I get: bash: mkfs.ext4: command not found I have googled and I actually can't seen to find Debian-specific instructions on how to create an ext...
I have just installed Debian 8.4 (Jessie, MATE desktop). For some reason the following command is not recognized: mkfs.ext4 -L hdd_misha /dev/sdb1 The error I get: bash: mkfs.ext4: command not found I have googled and I actually can't seen to find Debian-specific instructions on how to create an ext4 filesystem. Any help much appreciated!
misha256 (577 rep)
Apr 23, 2016, 04:54 AM • Last activity: Sep 17, 2024, 06:54 AM
4 votes
2 answers
491 views
How can I format a partition in a mapper device?
I created a mapper device with `dmsetup` and created a partition table with `parted`: ``` $ fdisk -l /dev/mapper/vdisk Disk /dev/mapper/vdisk: 511.57 GiB, 549295737344 bytes, 1072843237 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (mini...
I created a mapper device with dmsetup and created a partition table with parted:
$ fdisk -l /dev/mapper/vdisk
Disk /dev/mapper/vdisk: 511.57 GiB, 549295737344 bytes, 1072843237 sectors
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: gpt
Disk identifier: OMITTED

Device                       Start        End    Sectors   Size Type
/dev/mapper/vdisk-part1   2048     204799     202752    99M EFI System
/dev/mapper/vdisk-part2 204800 1072841188 1072636389 511.5G Microsoft basic data
Now how do I manipulate the partitions, say format the first partition to FAT? /dev/mapper/vdisk-part1 or /dev/mapper/vdisk1 don't seem to exist. PS: I do remember /dev/mapper/vdisk1 or something similar appeared after creating the partition table with parted, but disappeared after a reboot.
chienyan (43 rep)
Sep 11, 2024, 10:58 AM • Last activity: Sep 11, 2024, 11:30 AM
2 votes
1 answers
3389 views
Accidentally ran mkfs command on already available disk
I had a volume of 350Gb attached to my Linode server. It was running out of space so I resized it to 400GB from the dashboard and restarted my server. Then I used the df -h command to check if the disk has been resized or not but it was still showing 96% used. So I first unmounted my volume using `u...
I had a volume of 350Gb attached to my Linode server. It was running out of space so I resized it to 400GB from the dashboard and restarted my server. Then I used the df -h command to check if the disk has been resized or not but it was still showing 96% used. So I first unmounted my volume using umount /var/www/disk and then ran this command sudo mkfs -t ext4 /dev/sdc and after I remounted my volume and used ls command to check the file but there was nothing inside except lost+found file and when I used the df -h it shows that now the disk is 400gb and out of it 20gb of disk is being used but no file can be seen except lost+found file. I am still connected to my terminal till the time I restarted my server after resizing the volume from dashboard and I have copied the entire commands I used and their output scrolling up. Please help me to get my data back as it is extremely important. I would be very grateful of you. root@ubuntu:/var/www/html/processing# df -h Filesystem Size Used Avail Use% Mounted on /dev/root 78G 48G 27G 65% / devtmpfs 2.0G 4.0K 2.0G 1% /dev none 4.0K 0 4.0K 0% /sys/fs/cgroup none 392M 392K 392M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 0 2.0G 0% /run/shm none 100M 0 100M 0% /run/user /dev/sdc 345G 315G 15G 96% /var/www/disk root@ubuntu:/var/www/html/processing# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 1004M 0 disk [SWAP] sdc 8:32 0 400G 0 disk /var/www/disk sda 8:0 0 79G 0 disk / root@ubuntu:/var/www/html/processing# sudo mkfs -t ext4 /dev/sdc mke2fs 1.42.9 (4-Feb-2014) /dev/sdc is entire device, not just one partition! Proceed anyway? (y,n) y /dev/sdc is mounted; will not make a filesystem here! root@ubuntu:/var/www/html/processing# df -h Filesystem Size Used Avail Use% Mounted on /dev/root 78G 48G 27G 65% / devtmpfs 2.0G 4.0K 2.0G 1% /dev none 4.0K 0 4.0K 0% /sys/fs/cgroup none 392M 392K 392M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 0 2.0G 0% /run/shm none 100M 0 100M 0% /run/user /dev/sdc 345G 315G 15G 96% /var/www/disk root@ubuntu:/var/www/html/processing# sudo mkfs -t ext4 /dev/sdc mke2fs 1.42.9 (4-Feb-2014) /dev/sdc is entire device, not just one partition! Proceed anyway? (y,n) y /dev/sdc is mounted; will not make a filesystem here! root@ubuntu:/var/www/html/processing# sudo killall php screen root@ubuntu:/var/www/html/processing# sudo umount /disk umount: /disk: not found root@ubuntu:/var/www/html/processing# sudo umount /var/www/disk umount: /var/www/disk: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) root@ubuntu:/var/www/html/processing# fuser -kim /var/www/disk /var/www/disk: 1206 Kill process 1206 ? (y/N) y root@ubuntu:/var/www/html/processing# sudo umount /var/www/disk root@ubuntu:/var/www/html/processing# sudo mkfs -t ext4 /dev/sdc mke2fs 1.42.9 (4-Feb-2014) /dev/sdc is entire device, not just one partition! Proceed anyway? (y,n) y Discarding device blocks: done Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 26214400 inodes, 104857600 blocks 5242880 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 3200 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done root@ubuntu:/var/www/html/processing# df -h Filesystem Size Used Avail Use% Mounted on /dev/root 78G 48G 27G 65% / devtmpfs 2.0G 4.0K 2.0G 1% /dev none 4.0K 0 4.0K 0% /sys/fs/cgroup none 392M 392K 392M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 0 2.0G 0% /run/shm none 100M 0 100M 0% /run/user root@ubuntu:/var/www/html/processing# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 1004M 0 disk [SWAP] sdc 8:32 0 400G 0 disk sda 8:0 0 79G 0 disk / root@ubuntu:/var/www/html/processing# sudo mount /dev/sdc/ /var/www/disk root@ubuntu:/var/www/html/processing# df -h Filesystem Size Used Avail Use% Mounted on /dev/root 78G 48G 27G 65% / devtmpfs 2.0G 4.0K 2.0G 1% /dev none 4.0K 0 4.0K 0% /sys/fs/cgroup none 392M 392K 392M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 0 2.0G 0% /run/shm none 100M 0 100M 0% /run/user /dev/sdc 394G 71M 374G 1% /var/www/disk root@ubuntu:/var/www/html/processing# cd /var/www/disk root@ubuntu:/var/www/disk# ls lost+found root@ubuntu:/var/www/disk# sudo umount /var/www/disk umount: /var/www/disk: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) root@ubuntu:/var/www/disk# fuser -kim /var/www/disk /var/www/disk: 1573c Kill process 1573 ? (y/N) y Connection to 45.79.22.163 closed. zeeshan@zeeshan-VirtualBox:~$ sudo ssh root@45.79.22.163 root@45.79.22.163's password: Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 5.4.10-x86_64-linode132 x86_64) * Documentation: https://help.ubuntu.com/ New release '16.04.6 LTS' available. Run 'do-release-upgrade' to upgrade to it. Last login: Thu Feb 27 07:40:09 2020 from 119.155.0.120 root@ubuntu:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/root 78G 48G 27G 65% / devtmpfs 2.0G 4.0K 2.0G 1% /dev none 4.0K 0 4.0K 0% /sys/fs/cgroup none 392M 392K 392M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 0 2.0G 0% /run/shm none 100M 0 100M 0% /run/user /dev/sdc 394G 71M 374G 1% /var/www/disk root@ubuntu:~# fuser -kim /var/www/disk root@ubuntu:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/root 78G 48G 27G 65% / devtmpfs 2.0G 4.0K 2.0G 1% /dev none 4.0K 0 4.0K 0% /sys/fs/cgroup none 392M 392K 392M 1% /run none 5.0M 0 5.0M 0% /run/lock none 2.0G 0 2.0G 0% /run/shm none 100M 0 100M 0% /run/user /dev/sdc 394G 71M 374G 1% /var/www/disk root@ubuntu:~# sudo killall php screen php: no process found screen: no process found
zish (121 rep)
Feb 27, 2020, 10:10 AM • Last activity: Sep 6, 2024, 10:50 PM
1 votes
3 answers
4142 views
I can't access my USB device after mkfs.ntfs command
I had used these commands (as root): umount /dev/sdb1 After, mkfs.ntfs /dev/sdb1 It took a long time to format it and I couldn't wait it. Before it finished formatting, I had canceled operation. After I used my usb device for making copy operations, I couldn't use my usb device. Actually, Maybe it w...
I had used these commands (as root): umount /dev/sdb1 After, mkfs.ntfs /dev/sdb1 It took a long time to format it and I couldn't wait it. Before it finished formatting, I had canceled operation. After I used my usb device for making copy operations, I couldn't use my usb device. Actually, Maybe it wasn't about mkfs.ntfs command but there is a truth now: I can't use my flash drive. I plugged in my flash drive into my computer which uses linux mint. And I opened "Disks" program on Linux Mint. It is screenshot (after plugging in usb device): Disks Program - After plugging in usb device It is another screenshot (before plugging in usb device): Disks Program - Before plugging in usb device As you see, It says "No media" about /dev/sdb although I plugged in usb device. There isn't any problem about my OS (Linux Mint). The problem is about my usb device. I can see my other usb devices on Linux Mint. Have I burnt my usb device ? How can I solve this problem ? Edit: After intense desires of our participants , I should add it: I used these commands (there are commands with outputs below): LinuxMint linux # mkfs.ntfs /dev/sdb1 > Failed to access '/dev/sdb1': No such file or directory > The device doesn't exist; did you specify it correctly? LinuxMint linux # mkfs.ntfs /dev/sdb > Could not open /dev/sdb: no media So on, It can't recognize my usb device at all. Look at fdisk output: Command: fdisk -l Output: Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, toplam 625142448 sektör Units = sektör of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0007bccb Device Start End Sectors Size Type /dev/sda1 2048 251660287 125829120 83 Linux /dev/sda2 251660288 541255679 144797696 5 Extended /dev/sda3 * 541255680 619380679 39062500 83 Linux /dev/sda4 619380736 625141759 2880512 82 Linux swap / Solaris /dev/sda5 251662336 335548415 41943040 83 Linux /dev/sda6 335550464 457369599 60909568 83 Linux /dev/sda7 457371648 541255679 41942016 83 Linux
python_pardus (11 rep)
Jan 26, 2016, 01:20 PM • Last activity: Jul 13, 2024, 11:33 AM
1 votes
1 answers
177 views
ext2 How to choose bytes/inode ratio
How approximately calc [bytes-per-inode][1] for ext2? I have 7.3GB storage (15320519 sectors 512B each). I have made ext2 filesystem with block size 4096 mke2fs /dev/sda2 -i 524288 -m 0 -L "SSD" -F -b 4096 -U 11111111-2222-3333-4444-555555555555 -O none,filetype,sparse_super,large_file Filesystem la...
How approximately calc bytes-per-inode for ext2? I have 7.3GB storage (15320519 sectors 512B each). I have made ext2 filesystem with block size 4096 mke2fs /dev/sda2 -i 524288 -m 0 -L "SSD" -F -b 4096 -U 11111111-2222-3333-4444-555555555555 -O none,filetype,sparse_super,large_file Filesystem label=SSD OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 15104 inodes, 1915064 blocks 0 blocks (0%) reserved for the super user First data block=0 Maximum filesystem blocks=4194304 59 block groups 32768 blocks per group, 32768 fragments per group 256 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Usually all my files has size 100kB (and about 5 files can be 400MB). I try to read this and this . But still not clear how approximately calc bytes-per-inode? Current 524288 is not enough, for now I can't make new files in sda2 but still have a lot of free space. P.S. Extra info # df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/root ext4 146929 84492 59365 59% / devtmpfs devtmpfs 249936 0 249936 0% /dev tmpfs tmpfs 250248 0 250248 0% /dev/shm tmpfs tmpfs 250248 56 250192 0% /tmp tmpfs tmpfs 250248 116 250132 0% /run /dev/sda2 ext2 7655936 653068 7002868 9% /mnt/sda2 # df -h Filesystem Size Used Available Use% Mounted on /dev/root 143.5M 82.5M 58.0M 59% / devtmpfs 244.1M 0 244.1M 0% /dev tmpfs 244.4M 0 244.4M 0% /dev/shm tmpfs 244.4M 56.0K 244.3M 0% /tmp tmpfs 244.4M 116.0K 244.3M 0% /run /dev/sda2 7.3G 637.8M 6.7G 9% /mnt/sda2 # fdisk -l Disk /dev/sda: 7.45 GiB, 8001552384 bytes, 15628032 sectors Disk model: 8GB ATA Flash Di 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: 0x0a19a8af Device Boot Start End Sectors Size Id Type /dev/sda1 309 307508 307200 150M 83 Linux /dev/sda2 307512 15628030 15320519 7.3G 83 Linux
Андрей Тернити (303 rep)
May 22, 2024, 04:31 AM • Last activity: May 22, 2024, 01:24 PM
3 votes
1 answers
268 views
mkfs ext2 ignore number-of-inodes
I want to make ext2 file system. I want to set "[number-of-inodes][1]" option to some number. I tried several values: - if *-N 99000* then Inode count: 99552 - if *-N 3500* then Inode count: 3904 - if *-N 500* then Inode count: 976 But always my value is **not the same**. Why? I call mkfs this way s...
I want to make ext2 file system. I want to set "number-of-inodes " option to some number. I tried several values: - if *-N 99000* then Inode count: 99552 - if *-N 3500* then Inode count: 3904 - if *-N 500* then Inode count: 976 But always my value is **not the same**. Why? I call mkfs this way sudo mkfs -q -t ext2 -F /dev/sda2 -b 4096 -N 99000 -O none,sparse_super,large_file,filetype I check results this way $ sudo tune2fs -l /dev/sda2 tune2fs 1.46.5 (30-Dec-2021) Filesystem volume name: Last mounted on: Filesystem UUID: 11111111-2222-3333-4444-555555555555 Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: filetype sparse_super large_file Filesystem flags: signed_directory_hash Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 99552 Block count: 1973720 Reserved block count: 98686 Overhead clusters: 6362 Free blocks: 1967353 Free inodes: 99541 First block: 0 Block size: 4096 Fragment size: 4096 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 1632 Inode blocks per group: 102 Filesystem created: Thu Apr 6 20:00:45 2023 Last mount time: n/a Last write time: Thu Apr 6 20:01:49 2023 Mount count: 0 Maximum mount count: -1 Last checked: Thu Apr 6 20:00:45 2023 Check interval: 0 () Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 256 Required extra isize: 32 Desired extra isize: 32 Default directory hash: half_md4 Directory Hash Seed: 61ff1bad-c6c8-409f-b334-f277fb29df54
Андрей Тернити (303 rep)
Apr 6, 2023, 11:24 AM • Last activity: May 22, 2024, 04:21 AM
2 votes
0 answers
116 views
mkdosfs hangs forever, even when using timeout
I'm testing massive amounts of USB flash drives using a custom bash script that's based on [*f3*][1]. Before I perform `f3write` and `f3read` I format the drives, as my experience is some of the drives come from the factory not formatted properly - and hence cannot be used (or tested) in that such s...
I'm testing massive amounts of USB flash drives using a custom bash script that's based on *f3* . Before I perform f3write and f3read I format the drives, as my experience is some of the drives come from the factory not formatted properly - and hence cannot be used (or tested) in that such state. When I perform the testing, some of the bad drives hang the mkdosfs -I -F32 process forver. I've tried using timeout with SIGKILL to forcefully terminate the mkdosfs process after a few minutes if it doesn't finish, but that doesn't work. I've read that processes which execute kernel calls might go into uninterruptible sleep marked with a letter '*D*' in top or htop. That seems to be the case - the only way to terminate the processes I have found so far is to physically disconnect the USB flash drive that is being worked on. Right now these bad drives just never finish formatting. Here's a screenshot from htop: enter image description here I wonder what can I do to be able to stop the process - or at least detect that it has hung so I can notify the user. Maybe there's some software way to reset the USB port?
unfa (1825 rep)
Jul 11, 2018, 07:48 AM • Last activity: Oct 13, 2023, 01:44 AM
0 votes
0 answers
79 views
mkfs.vfat -- No such file or directory
I'm on Debian Bookworm. I am trying to format my USB drive to FAT32 filesystem. ``` ~$ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sdb └─sdb1 ntfs SONY 2DE23E532C9D2CAC ``` When I tried `mkfs` I get the following error: ``` sudo mkfs -t vfat /dev/sdb1 [sudo] password for vrgovin...
I'm on Debian Bookworm. I am trying to format my USB drive to FAT32 filesystem.
~$ lsblk -f
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sdb                                                                         
└─sdb1
     ntfs         SONY  2DE23E532C9D2CAC
When I tried mkfs I get the following error:
sudo mkfs -t vfat /dev/sdb1
[sudo] password for vrgovinda: 
mkfs: failed to execute mkfs.vfat: No such file or directory
I have the following installed:
exfatprogs
udisks2
Is there anything I am doing wrong? Please help. Thanks in advance.
vrgovinda (349 rep)
Aug 21, 2023, 02:18 AM • Last activity: Aug 21, 2023, 09:36 AM
0 votes
0 answers
203 views
How create isolated ext4 filesystem on file
There is a 25G /dev/sda6 ext4 partition mounted on /data. I'm trying to make a fixed size filesystem on a file using `fallocate`, `mkfs.ext4`, `mount`: ``` fallocate -l 5G /data/new_storage mkfs.ext4 -E nodiscard /data/new_storage mkdir /data/new_dir mount /data/new_storage /data/new_dir ``` However...
There is a 25G /dev/sda6 ext4 partition mounted on /data. I'm trying to make a fixed size filesystem on a file using fallocate, mkfs.ext4, mount:
fallocate -l 5G /data/new_storage
mkfs.ext4 -E nodiscard /data/new_storage
mkdir /data/new_dir
mount /data/new_storage /data/new_dir
However du for /data shows that /data/new_storage takes 4.9G instead of 5G. This happens after mkfs.ext4 is executed. At the same time, ls says that the file occupies 5G. Because of this, the new file system is not isolated, and if, after the creation of the child filesystem, the parent filesystem is completely filled, then filling the child filesystem can lead to errors:
loop: Write error at byte offset 2281734144, length 4096.
print_req_error: I/O error, dev loop0, sector 4456512
When using ext2, du shows exactly as much as was allocated, and there are no errors with similar behavior. Disabling journal for ext4 shows du a little closer to 5G, but still not equal to 5G. As expected behavior, there is a /dev/sda6 partition that will have 20G of 25G free (slightly less free due to service data), and a second looback /dev/loop0 partition of 5G (slightly less due to service data) isolated from each other. Is it possible to achieve this behavior? There is also the possibility that fstrim will be executed, which will result in holes being punched in the file. Is it possible to somehow completely disable the execution of fstrim on a new filesystem.
TheAct1on (1 rep)
Aug 3, 2023, 06:19 AM • Last activity: Aug 3, 2023, 06:59 AM
1 votes
1 answers
5291 views
how to make `mkfs.ext4 /dev/block/sda1` quickly?
I develop an application on Android, need to manage the disk, my program is root permission to run in the background of Android.One problem is that formatting disk partitions is so slow that it takes three hours to complete formatting on a `4TB` disk.The steps in my format are: 1. delete all partiti...
I develop an application on Android, need to manage the disk, my program is root permission to run in the background of Android.One problem is that formatting disk partitions is so slow that it takes three hours to complete formatting on a 4TB disk.The steps in my format are: 1. delete all partition 2. parted -s /dev/block/sda mklabel gpt 3. parted -s /dev/block/sda mkparted ext2 0% 100% 4. mkfs.ext4 -F -b 4096 /dev/block/sda1 Step 4 was slow when performing the above steps, so I replaced step 4 with: mkfs.ext4 -T lagerfile -F /dev/block/sda1 or mkfs.ext4 -F -b 4194304 /dev/block/sda1 but still slow. So what's a faster way? Thank you!
Clancy Zeng (11 rep)
May 28, 2022, 06:57 AM • Last activity: Jul 31, 2023, 10:05 AM
11 votes
3 answers
7115 views
Minimalistic ext4 filesystem without journal and other advanced features
I have a small "rescue" system (16 MB) that I boot into RAM as ramdisk. The [initrd][1] disk that I am preparing needs to be formatted. I think ext4 will do fine, but obviously, it doesn't make any sense to use journal or other advanced ext4 features. How can I create the most minimal ext4 filesyste...
I have a small "rescue" system (16 MB) that I boot into RAM as ramdisk. The initrd disk that I am preparing needs to be formatted. I think ext4 will do fine, but obviously, it doesn't make any sense to use journal or other advanced ext4 features. How can I create the most minimal ext4 filesystem? - without journal - without any lazy_init - without any extended attributes - without ACL without large files - without resizing support - without any unnecessary metadata The most bare minimum filesystem possible?
Martin Vegter (586 rep)
Jul 23, 2023, 01:34 PM • Last activity: Jul 31, 2023, 09:14 AM
0 votes
0 answers
165 views
I altered the partition table (resized the root and created a new partition and formatted it) but can't log into my arch system anymore
Yesterday, I had an idea of having two root partitions for my arch system, one which would contain packages and system files and another one to store my personal files (music, videos, etc). With that thought in my mind, I plugged in my arch-linux bootable usb flash drive into my PC and booted up the...
Yesterday, I had an idea of having two root partitions for my arch system, one which would contain packages and system files and another one to store my personal files (music, videos, etc). With that thought in my mind, I plugged in my arch-linux bootable usb flash drive into my PC and booted up the live-iso. Using cfdisk, I resized my main linux-file-system partition (the root partition, i.e, on /dev/sda1) to about half it's size (100G) and created another partition of 100G (on /dev/sda2), altered/wrote the partition table and then formatted the newly created partition on /dev/sda2 using:
.ext4 -L root /dev/sda2

But, after rebooting, 'arch' device won't boot and returns to the bios immediately after selecting it from the F12 (Select Boot Device) BIOS menu (it was supposed to show the grub bootloader after selecting 'arch' from F12 menu). Do I need to reset my partition table and again install arch from scratch? It wouldn't be a trouble for me to install arch-linux again as I installed it on a new hard disk, but I need to learn why this happened and what mistake have I have, so that I could fix it myself if it happens in future.
**My System Specifications (if required):**
- CPU: Intel Pentium G2030 - GPU: Intel HD Graphics (rare edition, doesn't has any number like HD 4000 or 2000 or like that) - RAM: 2GB DDR3 1600Mhz Single Channel (⁠٥-_-⁠) - Dedicated-GPU: None ⁠[⁠-⁠_⁠-⁠] - Hard-Disk: WD Green 500GB 7200RPM HDD
Asmit Das Choudhury (31 rep)
May 23, 2023, 08:10 AM • Last activity: May 26, 2023, 01:18 PM
Showing page 1 of 20 total questions