BTRFS

Started by mylo, 2012/12/15, 13:33:28

Previous topic - Next topic

mylo

Hi, I started experimenting with btrfs and set up a usb-stock with it by gparted.
I copied some photos to it but could not open the photos in gwenview.

Message: Loading of meta information failed

btrfs-tools are installed. Has anyone detected such a beahviour?

dibl

Hi mylo, I have two answers for you.  :)

1. The design of BTRFS is not at all ideal for a USB stick -- the main features (mirroring, striping, snapshots) have no use on a USB stick.  Plus, the "journalling" overhead -- the storing and updating of btrfs metadata -- is going to beat on your USB stick similar to ext3 or ext4 (or xfs or reiserfs), and cause faster wear than fat or ext2.  So I wouldn't advise using btrfs on a USB stick.

2. On a 16GB USB stick, I see no such problem as you described:

root@imerabox:/home/don# fdisk -lu
.
.
.
Disk /dev/sdf: 16.0 GB, 16013852672 bytes
64 heads, 32 sectors/track, 15272 cylinders, total 31277056 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
Disk identifier: 0x00000000

Disk /dev/sdf doesn't contain a valid partition table
root@imerabox:/home/don# dd if=/dev/null of=/dev/sdf bs=512 count=1
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000119586 s, 0.0 kB/s
root@imerabox:/home/don# mkfs.btrfs /dev/sdf

WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

fs created label (null) on /dev/sdf
       nodesize 4096 leafsize 4096 sectorsize 4096 size 14.91GB
Btrfs Btrfs v0.19
root@imerabox:/home/don# mount -t btrfs /dev/sdf /mnt/temp
root@imerabox:/home/don# ls -la /mnt/temp/
total 8
drwxr-xr-x 1 root root    0 Dec 15 09:40 .
drwxr-xr-x 7 root root 4096 May 30  2012 ..
root@imerabox:/home/don# cp *.rtf /mnt/temp
root@imerabox:/home/don# ls -la /mnt/temp
total 144
drwxr-xr-x 1 root root   200 Dec 15 09:41 .
drwxr-xr-x 7 root root  4096 May 30  2012 ..
-rwxr--r-- 1 root root 49372 Dec 15 09:41 James_Denson_descendants.rtf
-rw-r--r-- 1 root root  4494 Dec 15 09:41 jrboyd.rtf
-rwxr--r-- 1 root root 38174 Dec 15 09:41 Samuel_Davis_descendants.rtf
-rwxr--r-- 1 root root 35678 Dec 15 09:41 Samuel_Fitzpatrick_descendants.rtf
root@imerabox:/home/don#


No errors.

I chowned the btrfs directory to myself, and as a user, I copied an image file, and I see that the image was copied:

root@imerabox:/home/don# chown don:don /mnt/temp
root@imerabox:/home/don# exit
exit
don@imerabox:~$ cp greene_archives1.png /mnt/temp
don@imerabox:~$ ls -la /mnt/temp
total 7236
drwxr-xr-x 1 don  don      240 Dec 15 09:47 .
drwxr-xr-x 7 root root    4096 May 30  2012 ..
-rw-r--r-- 1 don  don  7262040 Dec 15 09:47 greene_archives1.png
-rwxr--r-- 1 root root   49372 Dec 15 09:41 James_Denson_descendants.rtf
-rw-r--r-- 1 root root    4494 Dec 15 09:41 jrboyd.rtf
-rwxr--r-- 1 root root   38174 Dec 15 09:41 Samuel_Davis_descendants.rtf
-rwxr--r-- 1 root root   35678 Dec 15 09:41 Samuel_Fitzpatrick_descendants.rtf


With dolphin, I browsed over to /mnt/temp, clicked on the image, and it popped open in gwenview with no issue.

So, look over the above procedure, and see if you have maybe overlooked something (like the chown step).
System76 Oryx Pro, Intel Core i7-11800H, ASRock B860 Pro-A, Intel Core Ultra 7 265KF, Nvidia GTX-1060, SSD 990 EVO Plus.

piper

Speaking of btrfs

Denial-of-Service Attack Found In Btrfs File-System

http://crypto.junod.info/2012/12/13/hash-dos-and-btrfs/
I have a Lucky Rabbit:    "Svoot" ..... (It's Swedish)

I am MAGA

dibl

Quote from: "piper"Speaking of btrfs

Denial-of-Service Attack Found In Btrfs File-System

http://crypto.junod.info/2012/12/13/hash-dos-and-btrfs/

Yikes!  Thanks for that, piper!

I guess it's a good thing that my BTRFS filesystem is accessible only by one semi-competent user!   :wink:
System76 Oryx Pro, Intel Core i7-11800H, ASRock B860 Pro-A, Intel Core Ultra 7 265KF, Nvidia GTX-1060, SSD 990 EVO Plus.

piper

I haven't messed with that file system yet on this newer system. I just need 3 3tb hard drives (after christmas) and I might use it. I am running out of room (mythtv) :)
System:    Host: x1 Kernel: 3.6-10.towo-siduction-amd64 x86_64 (64 bit)
          Desktop: KDE 4.8.4 Distro: siduction 12.2.0-ridersonthestorm-kde-amd64- (201212150546)
Machine:   Mobo: Gigabyte model: GA-970A-UD3 version: x.x Bios: Award version: F7 date: 10/22/2012
CPU:       Hexa core AMD FX-6300 Six-Core (-MCP-) cache: 12288 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm)
          Clock Speeds: 1: 1400.00 MHz 2: 1400.00 MHz 3: 3500.00 MHz 4: 1400.00 MHz 5: 1400.00 MHz 6: 1400.00 MHz
Graphics:  Card: NVIDIA GF106 [GeForce GTS 450] X.Org: 1.12.4 driver: nvidia Resolution: 1920x1200@60.0hz
          GLX Renderer: GeForce GTS 450/PCIe/SSE2 GLX Version: 4.2.0 NVIDIA 304.64
Audio:     Card-1: NVIDIA GF106 High Definition Audio Controller driver: snd_hda_intel Sound: ALSA ver: 1.0.25
          Card-2: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia (Intel HDA) driver: snd_hda_intel
Network:   Card: Realtek RTL8111/8168B PCI Express Gigabit Ethernet controller driver: r8169
          IF: eth0 state: up speed: 100 Mbps duplex: full mac: 90:2b:34:a5:99:2d
Drives:    HDD Total Size: 2320.5GB (74.8% used) 1: id: /dev/sda model: ST3320620AS size: 320.1GB
          2: id: /dev/sdb model: ST31000528AS size: 1000.2GB 3: id: /dev/sdc model: ST31000528AS size: 1000.2GB
Partition: ID: / size: 187G used: 24G (13%) fs: reiserfs ID: swap-1 size: 1.07GB used: 0.00GB (0%) fs: swap
Sensors:   System Temperatures: cpu: 16.8C mobo: N/A gpu: 30C
          Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 188 Uptime: 1:10 Memory: 815.9/7973.1MB Client: Shell inxi: 1.8.20
I have a Lucky Rabbit:    "Svoot" ..... (It's Swedish)

I am MAGA

dibl

That is a very nice rig piper.

My 2-drive btrfs filesystem is 2 years old, and is on a pair of 1TB Western Digital drives.  The "df" function of btrfs is kind of weird and doesn't quite tell the full story as you would expect (details in the wiki).  So this is what I see:

root@imerabox:/home/don# btrfs fi df /mnt/DATA
Data, RAID0: total=972.00GB, used=776.22GB
Data: total=8.00MB, used=0.00
System, RAID1: total=8.00MB, used=84.00KB
System: total=4.00MB, used=0.00
Metadata, RAID1: total=37.62GB, used=1.58GB
Metadata: total=8.00MB, used=0.00


The "972" only represents one of the two WD drives.  But the "776.xx" usage figure for RAID 0 is correct -- that is music, images, videos, and docs.

Here is one of the two drives:

root@imerabox:/home/don# smartctl -i /dev/sdd
smartctl 5.43 2012-06-05 r3561 [x86_64-linux-3.7-0.towo-siduction-amd64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Black
Device Model:     WDC WD1002FAEX-00Z3A0
Serial Number:    WD-WCATR3622553
LU WWN Device Id: 5 0014ee 2afb71534
Firmware Version: 05.01D05
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Sun Dec 16 09:08:56 2012 EST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


I'm not a filesystem expert, I just carefully followed the wiki instructions to make the filesystem, and mount it, and then dumped my data onto it.  The compression and caching capabilities came along after I originally made the filesystem, so I added that via the /etc/fstab line:

UUID=c112ed57-0e33-4d4b-82c9-5c55932c529d     /mnt/DATA            btrfs        device=/dev/sdd,device=/dev/sde,compress,space_cache,inode_cache   0    0

So, even though it is technically "experimental", I have not found it to have any issues on my hardware.  But I do keep backups around ....
System76 Oryx Pro, Intel Core i7-11800H, ASRock B860 Pro-A, Intel Core Ultra 7 265KF, Nvidia GTX-1060, SSD 990 EVO Plus.

piper

Thanks for that post, after I get the drives (these are old) and make some transfers, I will use these drives on one of my other machines and experiment and probably use raid also which I haven't for years. I came close to getting a 8-core but couldn't justify the benchmarks and price difference between the 2 piledrivers. This thing overclocks like a beast. I am good for at least another 4-5 years    maybe :)
I have a Lucky Rabbit:    "Svoot" ..... (It's Swedish)

I am MAGA

dibl

Right, that was my thinking when I bought this i7-950 CPU.  Here's a snippet of my /proc/cpuinfo that shows the overclock:

rocessor       : 6
vendor_id       : GenuineIntel
cpu family      : 6
model           : 26
model name      : Intel(R) Core(TM) i7 CPU         950  @ 3.07GHz
stepping        : 5
microcode       : 0xf
cpu MHz         : 4216.965


:)

BTW, the "RAID" that is reported by btrfs above is nothing to do with hardware -- that is simply the default data striping that btrfs provides.  So the price is right on that, too.
System76 Oryx Pro, Intel Core i7-11800H, ASRock B860 Pro-A, Intel Core Ultra 7 265KF, Nvidia GTX-1060, SSD 990 EVO Plus.