crash when mounting subvolume in a subdirectory

2010-12-06 Thread Michael Niederle
Hi! I'm not sure whether this *should* be possible, but I think it *shouldn't* crash: I created a snapshot of the root directory within a subdirectory: # mount /dev/sde2 /mnt # cd /mnt # mkdir save # btrfs subvolume snapshot . save/snap1 # umount /mnt Then I tried to mount the snapshot: # moun

mount snapshot by object-id

2010-12-09 Thread Michael Niederle
Hi! I'm currently writing a btrfs-rescue tool and therefor began to study the btrfs-on-disk structures in detail. The root tree contains a ROOT_ITEM entry for *every* subvolume in the whole file system, but only DIR_ITEM entries for subvolumes that were created in the root directory of the filesy

A rescue tool for btrfs

2010-12-16 Thread Michael Niederle
Hi! Last week I crashed a btrfs file system. I didn't lose a lot of data because I had current backups of most data and a full backup from a month ago. But I thought it would be a nice idea to have a rescue tool! Currently I have a first release of this tool (surely buggy and runnning on little e

Re: kernel BUG

2010-12-23 Thread Michael Niederle
Hi! >> Hi! I got a kernel BUG at >> >> fs/btrfs/disk-io.c:2311 >> >> when testing the 2.6.37-rc5 kernel today. > > It's good to mention which line this is, since the line numbers are > always changing. This is: > > if (total_errors > max_errors) { >

Re: kernel BUG

2010-12-23 Thread Michael Niederle
Hi, Chris! >> But exactly the same crash happened again some minutes ago. (I'm >> now back to my old kernel.) > > Not sure I understand. Do you mean that the same crash happens on > your older kernel now, or that you've reverted to your older kernel > because you had another -rc5 crash

Re: kernel BUG

2010-12-25 Thread Michael Niederle
Hi! It seems that in my case the bug (fs/btrfs/disk-io.c:2311) was caused by a hardware problem. I plugged by accident an usb-3.0-drive (that worked quite well for several weeks) into an usb-2.0-port (which worked quite well for several years). It seems that the two didn't like each other and cau

/dev/btrfs-control

2010-01-08 Thread Michael Niederle
Some btrfs-tools make use of "/dev/btrfs-control". How should I create this node? Is this a block or a character device (I suppose it should be a character device), which major and minor numbers should be assigned? I do not use udev, so I have to create all device nodes "by hand" or "by script".

snapshots of directories

2010-01-11 Thread Michael Niederle
I try to take a snapshot of a single directory, e.g. root: > btrfsctl -s root.2010-01-12 /root operation complete Btrfs v0.19-4-gab8fb4c-dirty Then I take look what's inside the newly created snapshot: > ls -l /root.2010-01-12/ total 0 drwxr-xr-x 1 root root 1192 2010-01-03 20:32:12 bin drwxr-xr

Free space left

2010-01-16 Thread Michael Niederle
How can I detect how much free space is left on a btrfs-volume? As I read (and learned in practice!) "df" reports cannot be trusted if used on btrfs-volumes. Greetings, Michael -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.k

Re: [RFC] Move all btrfs command to only one command

2010-01-21 Thread Michael Niederle
> $ btrfs > Usage: > btrfs clone|-c [/] > Clone the subvolume with the name in the > > directory. > > btrfs delete|-

btrfsck failed

2010-01-23 Thread Michael Niederle
I tried an (offline) btrfsck and got the following error message: > btrfsck /dev/sdb3 btrfsck: btrfsck.c:584: splice_shared_node: Assertion `!(src == &src_node->root_cache)' failed. Aborted I use kernel version 2.6.32.2 with builtin btrfs-drivers. Greetings, Michael -- To unsubscribe from this l

severe hardlink bug

2010-01-23 Thread Michael Niederle
I'm using btrfs with a kernel 2.6.32.2 (builtin) as the root file system of a Gentoo Linux installation. While attempting to install the plt-scheme package a strange error about link counts occurred ([Error 31] Too many Links). I was able to create a simple scenario to reproduce the error: Creat

btrfs subvol find-new

2010-03-26 Thread Michael Niederle
I want to write a differential backup tool for btrfs snapshots. The new "btrfs subvol find-new"-command sounds great on first encounter, but I'm missing informations about updated directories. I would need a list of updated directories to scan for deleted files. I had a look at find_updated_files

Re: Number of hard links limit

2010-08-02 Thread Michael Niederle
> Also, I believe it's not strictly 256 links, it's dependent on the length > of the names. > > I recall Chris posting something about being able to fix this without a > format change, though it wasn't a priority yet. As to my knowledge the limit is 64KB for all names of a single file and due to

btrfs-images

2010-08-04 Thread Michael Niederle
Hi! I also wanted to use btrfs-images, but changed my mind when I got troubles with several btrfs file systems derived from the same image. If more than one of these file system were physically connected at the same time, mounting one of them resulted in a mess. I think they all used the same int

Re: mount snapshot by object-id

2010-12-09 Thread Dipl.-Ing. Michael Niederle
Hi, Calvin! Thanks a lot for this information and for updating the wiki! The option works - on healthy disks ... I will continue writing my rescue-tool. I also wrote a btrfs_subvolumes command that displays all subvolumes of an unmounted filesystem. This helps a lot if mounting the filesystem le

kernel BUG

2010-12-23 Thread Dipl.-Ing. Michael Niederle
Hi! I got a kernel BUG at fs/btrfs/disk-io.c:2311 when testing the 2.6.37-rc5 kernel today. The system crashed while doing really nothing for a few minutes. Greetings, Michael -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.k

Still Problems with /dev/btrfs-control

2010-01-09 Thread Dipl.-Ing. Michael Niederle
Thanks for the quick reply! But I still have problems with btrfsctl: > stat /dev/btrfs-control File: `/dev/btrfs-control' Size: 0 Blocks: 0 IO Block: 4096 block special file Device: ch/12d Inode: 659848 Links: 1 Device type: a,3e Access: (0644/brw-r--r--)

How to mount a subvolume?

2010-01-09 Thread Dipl.-Ing. Michael Niederle
First thanks alot to Kay and Goffredo! But I have another question. I read that the current tools cannot display subvolumes, but one should still be able to mount them. If I try I get an error message: > mount -t btrfs -o subvol=root.2010-01-07 /dev/sda3 /save mount: /dev/sda3 is not a valid blo

Re: How to mount a subvolume?

2010-01-09 Thread Dipl.-Ing. Michael Niederle
Hi, Dirk! > Does /dev/sda3 actually exist? /dev/sda3 does exist; it is an btrfs formatted partition containing my root file system: > mount ... /dev/sda3 on / type btrfs (rw,relatime,noacl) ... Greetings, Michael @Johannes: I will recreate the /dev/brtfs-control device node in the startup scri

btrfsctl -s returns 1

2010-01-12 Thread Dipl.-Ing. Michael Niederle
I wrote a script generating snapshots of several subvolumes. But the script failed after taking the first snapshot. I then did it by hand: > btrfsctl -s /.backups/2010-01-12.1/home /home operation complete Btrfs v0.19-4-gab8fb4c > echo $? 1 Usually commands return 0 if everything went ok (and it

Re: Free space left

2010-01-16 Thread Dipl.-Ing. Michael Niederle
Hi, Goffredo! > Try btrfs-show Thanks for your advice! btrfs-show works but it displays a lot of error message for non-btrfs devices: > btrfs-show failed to read /dev/sdg failed to read /dev/sdg1 failed to read /dev/sdg2 failed to read /dev/sdg3 failed to read /dev/sdg4 failed to read /dev/md1

Re: severe hardlink bug

2010-01-24 Thread Dipl.-Ing. Michael Niederle
Hi, Goffredo! > See this thread: > Mass-Hardlinking Oops - http://thread.gmane.org/gmane.comp.file- > systems.btrfs/3427 Sorry, I didn't find the thread myself - despite of massive googeling. :-( The gentoo scenario however is a real world application - no artificial situation, so it would be r

Re: severe hardlink bug

2010-01-24 Thread Dipl.-Ing. Michael Niederle
Hi, Goffredo! I understood that a disk layout change will be necessary to accomodate for a bigger total filename-space per file. So it is best done at once when more issues arise that will need layout changes. To recreate the error situation you need a Gentoo Linux with a btrfs root file system a

Re: What's the benefit of COW without checksum?

2010-01-26 Thread Dipl.-Ing. Michael Niederle
I'm using btrfs for a distribution specialized to be used with USB pen drives. btrfs ist the first file system (besides nilfs) that is fast enough to be used with media (flash memory) that has a severe restriction on the number of writes per second (to be more precise: the number of page deletes p

Re: [PATCH 0/2] btrfs: a new tool to manage a btrfs filesystem

2010-02-14 Thread Dipl.-Ing. Michael Niederle
When creating new commands I always prefer increased readability and meaningfull names for subcommands and options. If one often enters commands directly at the command prompt one could use shell-aliases, if written in scripts long names make the scripts much easier to understand. It's great that

btrfs subvol find-modified

2010-03-26 Thread Dipl.-Ing. Michael Niederle
I have added a command btrfs subvolume find-modified List the recently modified files and directories in a filesystem. It's similar to find-new with the following differences: * in addition to modified files it will also display modified directories * it lists only the paths of the mo

Re: btrfs subvol find-modified

2010-03-26 Thread Dipl.-Ing. Michael Niederle
Hi, Chris! > Add an optional timestamp field to filter > files that have changed since a given timestamp. Is there a possibility to derive the timestamp directly from the generation number? If we have a "-e"-switch for printing extent-information we could also have another switch to decide wheth

btrfs subvol diff

2010-03-26 Thread Dipl.-Ing. Michael Niederle
> It is possible to combine the commands max-gen and find-new ? Something like: > > $ btrfs subvol find-new subvol1 snap1 I had very similar thoughts myself. If we compare two snapshots (of the same subvolume) we wouldn't need timestamps either, e.g.: btrfs subvol diff The output could

directory order in btrfs

2010-03-27 Thread Dipl.-Ing. Michael Niederle
Hi, Chris! I'm writing the btrfs snapshot diff tool and I would like to know, whether the entries in a btrfs directory are ordered in some way. I want to find missing entries in a new snapshot's directory. Can I do a "linear compare" of the old and new directories or do I have to sort the entries

Missing entry for updated directory

2010-03-27 Thread Dipl.-Ing. Michael Niederle
I'm using BTRFS_DIR_INDEX_KEY as suggested by Chris to find all updated directories. But I'm missing one: The directory has 3 entries deleted and stat shows different mtimes and ctimes for the directory in the two snapshots. The highest generation number in the older snapshot is 82623. But the

Re: Missing entry for updated directory

2010-03-27 Thread Dipl.-Ing. Michael Niederle
Hi, Goffredo! I checked all btrfs-item types (changed sk->max_type to 255 and removed the filtering) connected with the updated directory's inode. But none of them had got a new generation number. I found the missing directory only using a more conventional tool that checked all files and direct