How to find the disk space left for a file on Linux? For example, a program may append data to a file: /mnt/logs/app-log.log How to find which partition the app-log.log is on and how much disk space left on that partition? Use this command: $ df -B1 /mnt/logs/app-log.log | tail -1 | cut -d’ ‘
Read more
Tag: partition
Mount Ext4 Partitions in Windows in read-only mode
Posted onHow to mount Ext4 partitions from Linux in Windows in read-only mode? Read-only is required to ensure safety. Mounting is required so that traditional programs can use the partition without any changes. Ext2Fsd is a great tool for this. Ext2Fsd is a file system driver which allows accessing (both reading and writing) ext2, ext3 or
Read more
How to make a swap partition
Posted onHow to make a swap partition on Linux? First, make a new partition (or reuse an existing one if you like). I suggest using cfdisk to create it: https://www.systutorials.com/docs/linux/man/8-cfdisk/ Then, turn the new partition (say, /dev/sdc1) to a swap # mkswap /dev/sdc1 Lastly, turn it on # swapon /dev/sdc1 You can check whether its status
Read more
Setting Swap Priority in Linux
Posted onHow to set swap priority in Linux? Can I use 2 swap partition at the same time? You can set the priority of swap in Linux by swapon. For example, to set /dev/sdc1‘s priority to 0: # swapoff /dev/sdc1; swapon -p 0 /dev/sdc1 You can also put one entry into the /etc/fstab to make it
Read more
How to search bad blocks on a device?
Posted onIf I have a disk with bad blocks, how to search bad blocks on it under Linux? You can use ‘badblocks’: https://www.systutorials.com/docs/linux/man/8-badblocks/ badblocks [ -svwnf ] [ -b block-size ] [ -c blocks_at_once ] [ -e max_bad_blocks ] [ -d read_delay_factor ] [ -i input_file ] [ -o output_file ] [ -p num_passes ] [
Read more
Forcing Linux to Unmount a Filesystem Reporting “device is busy”
Posted onLinux may report “device is busy” when we try to umount a filesystem. This behavior is reasonable as it can help us avoid data loss by disallowing unmouting a filesystem when it is being used. But for situations when we are sure there is something wrong happened or we care not data lost such as
Read more
Shrinking an Ext4 File System on LVM in Linux
Posted onIn Extending a Mounted Ext4 File System on LVM in Linux, we introduced how to extend a mounted ext4 filesystem on LVM Logical volume by adding a new physical volume. It is also common to shrink an ext4 file system as to spare some disk space. In this post, I will discuss how to shrink
Read more
Making GPT Partition Table and Creating Partitions Using parted in Linux
Posted onMy best favorite disk partition table manipulation tools are cfdisk/fdisk on Linux. However, for large disks, cfdisk/fdisk (of the versions by this post is written) will just give up with a message suggesting GPT partition table format and using GNU parted like WARNING: The size of this disk is 6.0 TB (6001042391040 bytes). DOS partition
Read more
Extending Mounted Ext4 File System on LVM in Linux
Posted onLVM is a great tool to manage hard disks on Linux—you can abstract the hard drives away and manage logical volumes from volume groups, you can dynamically add or remove hard drives while the file systems on the logical volumes need not to backed up and recovered, and you may create many snapshots of the
Read more
Data Consistency Models of Public Cloud Storage Services: Amazon S3, Google Cloud Storage and Windows Azure Storage
Posted onThe public cloud storage services like Amazon S3, Google Cloud Storage and Windows Azure Storage replicate the data to ensure high availability. On the other hand, with data being replicated, the storage services exhibits certain data consistency models. Different cloud service providers employ different data consistency models nowadays. In this post, we survey the data
Read more
How to Find Out Failed Disks’ SATA Ports in Linux
Posted onThe Linux disk names (e.g. sda1, hdb3, etc.) are not reliable—they may be changed if there are hardware changes, such an adding or removing a disk. Additionally, the order for the Linux device names is not always the same as the order of SATA poets. For example, the disk connected to SATA port 0 (first
Read more
Extending a LVM Volume Group
Posted onWe introduced how to create a LVM group with two hard disk partitions, which the LVM group can be used for [[setting-up-lvm-backed-xen-domu|installing LVM backed Xen DomUs]]. The LVM volume can have large capacity from several hard disks. However, we may use all the disk space after some time and we may need to extend the
Read more
Creating LVM Volume Group
Posted onHow to create a LVM group from two hard disk partitions is introduced in this post. Assume we have installed two hard disks /dev/sdb and /dev/sdc to the server, our task now is to create one LVM volume group vg_xen for installing LVM backed Xen DomUs from these two disks. We will do this by
Read more
Setting up Stable Xen Dom0 with Fedora: Xen 3.4.3 with Xenified Linux Kernel 2.6.32.13 in Fedora 12
Posted onThis is the latest stable and recommended stable Xen Dom0 solution on Fedora 12. No serious bug found till now and we will fix the bugs by ourselves if some appears. It also works on Fedora 14 as well. It should not be hard to use this solution on other versions of Fedora or other
Read more
How to Create Fedora Live USB Media
Posted onHow to create a Fedora live USB media is introduced in this post. We can boot to Fedora operating system environment through a live USB system in the USB flash media on a USB-bootable computer without writing the computer’s hard disk. We can also install Fedora operating system from the live system environment. Remember to
Read more
An I/O Performance Comparison Between loopback Backed and blktap Backed Xen File-backed VBD
Posted onI have done some I/O performance benchmark test of Xen DomU. For easier management, some of our DomU VMs are using file-backed VBDs. Previously, our VMs are using Loopback-mounted file-backed VBDs. But blktap-based support are recommended by Xen community. Before considering changing from loopback based VBD to blktap based VBD, I have done this performance
Read more