Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] file system usage?
On Tue, 13 Jun 2017 12:23:57 -0400, Felix Miata wrote:
Istvan Gabor composed on 2017-06-13 15:14 (UTC+0200):
.
I have to identical partitions I formatted with the same tool.
I copied everything from one partition to the other still
the file system usage is different. Why?
.
rsync -a /mnt1/ /mnt2
.
Interestingly the file systems usage is not the same for
the two partitions (part7 is mnt1, part8 is mnt2):
.
df -h
Filesystem Size Used Avail Use% Mounted on
.
/dev/sdc7 28G 6.1G 21G 24% /mnt1
/dev/sdc8 28G 6.7G 20G 26% /mnt2
.
Why is this difference?
.
man rsync tells you:
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
...
-H, --hard-links preserve hard links

My reading is unless you preserve hard links, you get at least two separate
files on the target for each hard linked file on the source. So if you really
want a clone, either clone, or use rsync -aHAX.

I compared rsync -a and rsync -aHAX.
I have two pieces of identical hard drives.
I formatted on both the first primary partiton (same size)
to ext3 using mkfs -t ext3.

These are the partitions:

sfdisk -l /dev/sda
Disk /dev/sda: 298.1 GiB, 320068705792 bytes, 625134191 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: dos
Disk identifier: 0x1e951881

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 104859647 104857600 50G 83 Linux


sfdisk -l /dev/sdb
Disk /dev/sdb: 298.1 GiB, 320068705792 bytes, 625134191 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: dos
Disk identifier: 0x1e951881

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 104859647 104857600 50G 83 Linux

That is the disks and the partition look identical.

I mount /dev/sda1 to /mnt1 (read only) and /dev/sdb1 to /mnt2.
/dev/sdb2 had a freshly formatted file system.
I deleted lost+found from /mnt2 the rsynced everything from
mnt1 to mnt2:

# rsync -aHAX /mnt1/ /mnt2/

After it I get:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 44G 3.5G 93% /mnt1
/dev/sdb1 50G 43G 3.7G 93% /mnt2

# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 51475068 45240120 3613508 93% /mnt1
/dev/sdb1 51475068 45034476 3819152 93% /mnt2

There is difference in used and free space.
It is ~200 MBs if I calculate correctly.
??

tune2fs gives:

# tune2fs -l /dev/sda1
tune2fs 1.42.11 (09-Jul-2014)
Filesystem volume name: <none>
Last mounted on: /mnt1
Filesystem UUID: 1fe642de-fba4-4e71-804d-a49678ee8f4a
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index 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: 3276800
Block count: 13107200
Reserved block count: 655360
Free blocks: 1558737
Free inodes: 3260644
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1020
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Filesystem created: Sat Jun 3 12:36:03 2017
Last mount time: Tue Jun 13 17:02:22 2017
Last write time: Tue Jun 13 17:16:04 2017
Mount count: 9
Maximum mount count: -1
Last checked: Sat Jun 3 12:36:03 2017
Check interval: 0 (<none>)
Lifetime writes: 25 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 20f34777-5a2a-4f37-8066-b3304b2a25bf
Journal backup: inode blocks

# tune2fs -l /dev/sdb1
tune2fs 1.42.11 (09-Jul-2014)
Filesystem volume name: <none>
Last mounted on: /mnt2
Filesystem UUID: 690c6d35-44ab-4d4f-b8b1-565221582a8b
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery 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: 3276800
Block count: 13107200
Reserved block count: 655360
Free blocks: 12855468
Free inodes: 3276789
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1020
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Filesystem created: Wed Jun 14 18:28:40 2017
Last mount time: Wed Jun 14 18:29:11 2017
Last write time: Wed Jun 14 18:29:11 2017
Mount count: 1
Maximum mount count: -1
Last checked: Wed Jun 14 18:28:40 2017
Check interval: 0 (<none>)
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: c2043247-ca58-45a4-affc-52c1dc46b664
Journal backup: inode blocks

Istvan




--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >