Hot answers tagged

13

Well, first, what is an inode? In the Unix world, an inode is a kind of file entry. A filename in a directory is just a label (a link!) to an inode. An inode can be referenced in multiple locations (hardlinks!). -i bytes-per-inode (aka inode_ratio) For some unknown reason this parameter is sometime documented as bytes-per-inode and sometime as inode_ratio. ...


13

Do you have /sbin in your path? Most likely you are trying to run mkfs.ext4 as a normal user. Unless you've added it yourself (e.g. in ~/.bashrc or /etc/profile etc), root has /sbin and /usr/sbin in $PATH, but normal users don't by default. Try running it from a root shell (e.g. after sudo -i) or as: sudo mkfs.ext4 -L hdd_misha /dev/sdb1 BTW, normal ...


12

There is better alternative than dd to extend a file. The dd command requires several parameters to run properly (to not corrupt your data). I use truncate instead. Despite of its name it can extend the size of a file as well: truncate - shrink or extend the size of a file to the specified size -s, --size=SIZE set or adjust the file size by SIZE ...


10

LVM doesn't change the way you format a partition. Let's say you would have a volume group called group1 and a logical volume called volume1 then your command should look like this for ext3: mkfs.ext3 /dev/group1/volume1 In case you don't have any volume groups or logical volumes yet, you have to use the according LVM tools to create them. The manpages of ...


10

Creating a filesystem on a whole disk rather than a partition is possible, but unusual. The documentation only explicitly mentions the partition because that's the most usual case (it does say usually). You can create a filesystem on anything that acts sufficiently like a fixed-size file, i.e. something where if you write data at a certain location and read ...


9

You can use graphical tools to achieve this, such as GParted. You can install this like so: apt-get update apt-get install gparted Your OS may also include a graphical package manager, if so, you can alternatively install the gparted package from there. After gparted is installed, run it. Select your flash drive (be careful, make sure it is the right ...


8

You generally don't want to write the filesystem on the entire block device (ie. /dev/sdd), you want to create a partition and then put the filesystem in there (ie. /dev/sdd1). That is also what your mkfs complained about. If you are sure you only want to have one filesystem on this disk at a time, and you don't need a bootloader, you can safely ignore this ...


8

You could use GUI applications like GParted on Ubuntu. Install them from the repositories using: sudo apt-get install gparted Once you have it installed, select the correct block device/partition and format it using a filesystem like ext2/3/4, JFS, XFS, ResiserFS, etc depending on your needs. However, the above mentioned file systems are only for ...


7

If you want to create a filesystem on your usb stick partition, you should do mkfs -t vfat /dev/sdc1 as a user who as access rights to write to the partition, like root


7

You can use Disk Utility (diskutil from command-line). For example: diskutil eraseDisk JHFS+ VolumeName /dev/disk2 Refer to the manual page.


7

It is generally fine to put a filesystem on a whole device, rather than partitioning and formatting the partitions, if you do not intend to have more than one filesystem on your device. You will simply have to be consistent; since your put the filesystem on sda rather than sda1, you will have to mount sda as well, since sda1 will not exist at all. The ...


7

No and yes. The command to create the filesystem is the one that generates the UUID. So, before running it there is no UUID to use to name the filesystem. However, it is posible to use an specific UUID to create the filesystem: $ uuid=$(uuidgen) $ echo "$uuid" 9a7d78e5-bc6c-4b19-94da-291122af9cf5 $ mkfs.ext4 -U "$uuid" The uuidgen program which is part ...


6

It should be mkfs.vfat -I /dev/sdb. sdb1 indicates you probably have more than one partition, and you're just formatting the first one, which happens to be 64MiB.


6

The command you want is wipefs -a. When deleting partitions that you have no intent of recovering data from, run this on each partition prior to deleting it. In this particular case however, you can probably just pass -f to the mkfs command you're trying to run on that partition, and it will ignore what's there and create a new filesystem (don't get in the ...


5

TRIM is a command that needs to be sent for individual blocks. I have asked the question before (What is the recommended way to empty a SSD?) and it is suggested to use ATA Secure Erase, a command that is sent to the device to clear all data.


5

mkfs.ext4 has an extra option -E discard to send TRIM for appropriate blocks when creating the filesystem. I can't tell whether the installer uses this option, or whether it is used by mkfs.ext4 by default, but at least you can explicitly use it when creating the filesystems on your own.


5

bytes-per-inode determines how many inodes are created for that file system; inode-size determines how big each of those inode is. You need a lot of inodes if you intend to put lots of small files (&/or lots of directories) on the filesytem. AFAIK, you really only need inodes that are larger than the default size of 256 bytes if you want to store ...


5

From man badblocks: -o output_file Write the list of bad blocks to the specified file. Without this option, badblocks displays the list on its standard output. The format of this file is suitable for use by the -l option in e2fsck(8) or mke2fs(8). So the correct way would be: badblocks -o filename /dev/sde1 ...


5

tune2fs applies only to ext[2-4] filesystems; not to XFS ones. The "Bad magic number in super-block" simply means that tune2fs doesn't understand the filesystem type. As you noted, the fact that your filesystem can be mounted confirms that it's viable.


5

On BSD-derived Unix systems, newfs is more commonly used than mkfs. Under Mac OS X, you would use newfs_type as the command, where type is one of hfs, msdos, exfat or udf. There are man pages for all of these. As the other answer mentions, you can use diskutil to create filestems but by using the newfs variants you can set specific filesystem parameters ...


5

To create an image with multiple partitions, a solution that doesn't require any fancy tools or root access is to first create the filesystems, then concatenate them. truncate -s $IMAGE_ROOTFS_ALIGNMENT disk truncate -s $BOOT_SPACE_ALIGNED part1 mkfs.fat part1 cat part1 >>disk truncate -s $ROOTFS_SIZE part2 mkfs.ext4 part2 cat part2 >>disk Then ...


5

Double the size: umount /some/user/folder dd if=/dev/zero bs=1M count=500 seek=500 >>MyDrive.vhd resize2fs MyDrive.vhd


5

This is due to the fact that the hyperconverged hypervisor uses SSD's. The mkfs command formats with NODISCARD (also known as TRIM) by default. To run mkfs without trim, use the -K option on XFS and -E nodiscard on ext4 XFS mkfs.xfs -K /dev/sdx EXT4 mkfs.ext4 -E nodiscard Warning: Only use -K or -E on new volumes with no existing data. Using the -K ...


5

This is supported in the installer. To choose the usage type of a partition created during installation, you need to proceed as follows: when you get to the partition phase, select “Manual” (you can still have guided partitioning in the manual partitioning tool) choose the drive you want to partition confirm you want to create a partition table (if ...


5

As @derobert mentioned in the comment. mkfs.ext4/mke2fs refers to /etc/mke2fs.conf and formats the partition. mke2fs chooses block size based on the partition size if not explicitly mentioned. Read -b block-size and -T usage-type in mke2fs man page for the same. So when partition size is less than 512MB mkfs.ext4 formats it as small with following ...


5

A physical sector size of 4096 means that the data on the drive is laid out in units of 4096 bytes, i.e. disk comprised of sequential "compartments" of 4096 bytes, that have to be written atomically. For compatibility reasons, most disks with 4096 byte sectors present themselves as having traditional 512 byte "logical sectors", which means the addressing ...


5

Alignment doesn’t matter for the end sector. Sectors are numbered from 0; fdisk is suggesting the last sector on your disk (which has 250069680 sectors). Start: 2048 End: 250069679 Sectors: 250067632 is correct, 250069679 minus 2048 plus one is 250067632: the partition contains 250067632 sectors, starting at offset 2048.


4

Quick steps and results (summarised from the ATA Secure Erase page) follow: If the output is not what is expected, see the full page. Replace /dev/X with your device. hdparm -I /dev/X should include "not frozen" - if frozen (see notes below on what went wrong for me): Suspend the computer, complete the rest of these steps then power off (see notes) or try ...


4

When you create a partition, it contains whatever was there before. For example, if you delete a partition that contained a filesystem and recreate a partition at exactly the same location without having written to that space in between, then you'll get the filesystem that was there before, intact. If the new partition starts at the same location as the old ...


4

how to know if some data already exist on /dev/sde You can try to mount it. You can try examining the disk partition table. But if you don't use the proper tool that can understand what's actually on the disk, whatever tool you use will likely report that there's no data on the disk. So in the final analysis, you need to know what's on the disk before you ...


Only top voted, non community-wiki answers of a minimum length are eligible