| Yehuda Sadeh | dfc5606 | 2010-11-19 14:51:04 -0800 | [diff] [blame] | 1 | What:		/sys/bus/rbd/ | 
 | 2 | Date:		November 2010 | 
| Sage Weil | 55b00ba | 2011-03-21 15:06:50 -0700 | [diff] [blame] | 3 | Contact:	Yehuda Sadeh <yehuda@newdream.net>, | 
| Yehuda Sadeh | dfc5606 | 2010-11-19 14:51:04 -0800 | [diff] [blame] | 4 | 		Sage Weil <sage@newdream.net> | 
 | 5 | Description: | 
 | 6 |  | 
 | 7 | Being used for adding and removing rbd block devices. | 
 | 8 |  | 
 | 9 | Usage: <mon ip addr> <options> <pool name> <rbd image name> [snap name] | 
 | 10 |  | 
 | 11 |  $ echo "192.168.0.1 name=admin rbd foo" > /sys/bus/rbd/add | 
 | 12 |  | 
 | 13 | The snapshot name can be "-" or omitted to map the image read/write. A <dev-id> | 
 | 14 | will be assigned for any registered block device. If snapshot is used, it will | 
 | 15 | be mapped read-only. | 
 | 16 |  | 
 | 17 | Removal of a device: | 
 | 18 |  | 
 | 19 |   $ echo <dev-id> > /sys/bus/rbd/remove | 
 | 20 |  | 
 | 21 | Entries under /sys/bus/rbd/devices/<dev-id>/ | 
 | 22 | -------------------------------------------- | 
 | 23 |  | 
 | 24 | client_id | 
 | 25 |  | 
 | 26 | 	The ceph unique client id that was assigned for this specific session. | 
 | 27 |  | 
 | 28 | major | 
 | 29 |  | 
 | 30 | 	The block device major number. | 
 | 31 |  | 
 | 32 | name | 
 | 33 |  | 
 | 34 | 	The name of the rbd image. | 
 | 35 |  | 
 | 36 | pool | 
 | 37 |  | 
 | 38 | 	The pool where this rbd image resides. The pool-name pair is unique | 
 | 39 | 	per rados system. | 
 | 40 |  | 
 | 41 | size | 
 | 42 |  | 
 | 43 | 	The size (in bytes) of the mapped block device. | 
 | 44 |  | 
 | 45 | refresh | 
 | 46 |  | 
 | 47 | 	Writing to this file will reread the image header data and set | 
 | 48 | 	all relevant datastructures accordingly. | 
 | 49 |  | 
 | 50 | current_snap | 
 | 51 |  | 
 | 52 | 	The current snapshot for which the device is mapped. | 
 | 53 |  | 
 | 54 | create_snap | 
 | 55 |  | 
 | 56 | 	Create a snapshot: | 
 | 57 |  | 
 | 58 | 	 $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_create | 
 | 59 |  | 
| Yehuda Sadeh | dfc5606 | 2010-11-19 14:51:04 -0800 | [diff] [blame] | 60 | snap_* | 
 | 61 |  | 
 | 62 | 	A directory per each snapshot | 
 | 63 |  | 
 | 64 |  | 
 | 65 | Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name> | 
 | 66 | ------------------------------------------------------------- | 
 | 67 |  | 
 | 68 | id | 
 | 69 |  | 
 | 70 | 	The rados internal snapshot id assigned for this snapshot | 
 | 71 |  | 
 | 72 | size | 
 | 73 |  | 
 | 74 | 	The size of the image when this snapshot was taken. | 
 | 75 |  | 
 | 76 |  |