All of lore.kernel.org
 help / color / mirror / Atom feed
* caching device setup
@ 2015-04-06 15:44 arnaud gaboury
  2015-04-06 15:57 ` David Mohr
       [not found] ` <CAPBO7TY13PYVh3d0bt3tkc_+_vJVybCy-kBBT223VfPmQkjuWw@mail.gmail.com>
  0 siblings, 2 replies; 8+ messages in thread
From: arnaud gaboury @ 2015-04-06 15:44 UTC (permalink / raw)
  To: linux-bcache

Here is my overall plan:

root filesystem & OS on a SSD
DB and other stuff on HD.
Use ssd as caching device and HD as backing.

Shall I partition the SSD with : one partition for OS and one empty
for bcache? Or install the OS on the whole SSD and use the whole SSD
as caching device?

Thank you for hint.

-- 

google.com/+arnaudgabourygabx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: caching device setup
  2015-04-06 15:44 caching device setup arnaud gaboury
@ 2015-04-06 15:57 ` David Mohr
  2015-04-08 18:56   ` Kai Krakow
       [not found] ` <CAPBO7TY13PYVh3d0bt3tkc_+_vJVybCy-kBBT223VfPmQkjuWw@mail.gmail.com>
  1 sibling, 1 reply; 8+ messages in thread
From: David Mohr @ 2015-04-06 15:57 UTC (permalink / raw)
  To: arnaud gaboury; +Cc: linux-bcache, linux-bcache-owner

On 2015-04-06 09:44, arnaud gaboury wrote:
> Here is my overall plan:
> 
> root filesystem & OS on a SSD
> DB and other stuff on HD.
> Use ssd as caching device and HD as backing.
> 
> Shall I partition the SSD with : one partition for OS and one empty
> for bcache? Or install the OS on the whole SSD and use the whole SSD
> as caching device?
> 
> Thank you for hint.

So this is just depending on your preference, how big the SSD is, and 
how much space you expect your OS to take up.

Personally I split my SSD into two partitions: one for the root FS, and 
the other as a caching device for /home.

~David

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: caching device setup
       [not found] ` <CAPBO7TY13PYVh3d0bt3tkc_+_vJVybCy-kBBT223VfPmQkjuWw@mail.gmail.com>
@ 2015-04-06 17:44   ` arnaud gaboury
  0 siblings, 0 replies; 8+ messages in thread
From: arnaud gaboury @ 2015-04-06 17:44 UTC (permalink / raw)
  To: Josep Lladonosa; +Cc: linux-bcache

On Mon, Apr 6, 2015 at 6:03 PM, Josep Lladonosa <jlladono@gmail.com> wrote:
>
> On 6 Apr 2015 17:46, "arnaud gaboury" <arnaud.gaboury@gmail.com> wrote:
>>
>> Here is my overall plan:
>>
>> root filesystem & OS on a SSD
>> DB and other stuff on HD.
>> Use ssd as caching device and HD as backing.
>>
>> Shall I partition the SSD with : one partition for OS and one empty
>> for bcache? Or install the OS on the whole SSD and use the whole SSD
>> as caching device?
>
> You need a specific partition as a caching device for bcache.

Thank you.


>>
>> Thank you for hint.
>>
>> --
>>
>> google.com/+arnaudgabourygabx
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 

google.com/+arnaudgabourygabx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: caching device setup
  2015-04-06 15:57 ` David Mohr
@ 2015-04-08 18:56   ` Kai Krakow
  2015-04-09  3:05     ` Lidong Zhong
  2015-04-09  3:08     ` Lidong Zhong
  0 siblings, 2 replies; 8+ messages in thread
From: Kai Krakow @ 2015-04-08 18:56 UTC (permalink / raw)
  To: linux-bcache

David Mohr <david@mcbf.net> schrieb:

> On 2015-04-06 09:44, arnaud gaboury wrote:
>> Here is my overall plan:
>> 
>> root filesystem & OS on a SSD
>> DB and other stuff on HD.
>> Use ssd as caching device and HD as backing.
>> 
>> Shall I partition the SSD with : one partition for OS and one empty
>> for bcache? Or install the OS on the whole SSD and use the whole SSD
>> as caching device?
>> 
>> Thank you for hint.
> 
> So this is just depending on your preference, how big the SSD is, and
> how much space you expect your OS to take up.
> 
> Personally I split my SSD into two partitions: one for the root FS, and
> the other as a caching device for /home.

The other preference is valid, too: I chose to put bcache only on the SSD to 
get maximum benefit from its capacity, rootfs and home dynamically share the 
cache then depending on demands. So rootfs is a bit slower as natively on 
SSD but home can gain much more because unsed parts of the rootfs are 
available for caching.

The split-setup preference in turn gives you a fallback boot option in case 
bcache chokes: You still have a working rootfs to do repairs or restore 
backups. In my setup I encounter that problem with a working USB3-HD mirror 
of my system I can boot and restore from which is synced and snapshotted 
every night (so it also protects against accidental file deletion synced 
undetected into the backup). Most valuable data is stored remotely (photos, 
source code, documents, configuration, etc).

-- 
Replies to list only preferred.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: caching device setup
  2015-04-08 18:56   ` Kai Krakow
@ 2015-04-09  3:05     ` Lidong Zhong
  2015-04-10 22:26       ` Kai Krakow
  2015-04-09  3:08     ` Lidong Zhong
  1 sibling, 1 reply; 8+ messages in thread
From: Lidong Zhong @ 2015-04-09  3:05 UTC (permalink / raw)
  To: Kai Krakow, linux-bcache

>>> On 4/9/2015 at 02:56 AM, in message <98agvb-l7r.ln1@hurikhan77.spdns.de>, Kai
Krakow <hurikhan77@gmail.com> wrote: 
> David Mohr <david@mcbf.net> schrieb: 
>  
> > On 2015-04-06 09:44, arnaud gaboury wrote: 
> >> Here is my overall plan: 
> >>  
> >> root filesystem & OS on a SSD 
> >> DB and other stuff on HD. 
> >> Use ssd as caching device and HD as backing. 
> >>  
> >> Shall I partition the SSD with : one partition for OS and one empty 
> >> for bcache? Or install the OS on the whole SSD and use the whole SSD 
> >> as caching device? 
> >>  
> >> Thank you for hint. 
> >  
> > So this is just depending on your preference, how big the SSD is, and 
> > how much space you expect your OS to take up. 
> >  
> > Personally I split my SSD into two partitions: one for the root FS, and 
> > the other as a caching device for /home. 
>  
> The other preference is valid, too: I chose to put bcache only on the SSD to  
>  
> get maximum benefit from its capacity, rootfs and home dynamically share the  
>  
Hi David,
I am curious about how rootfs and home share the SSD dynamically. Are they on
the same partition? Sorry for stupid questions since I just touched bcache recently.

Regards,
Lidong
> cache then depending on demands. So rootfs is a bit slower as natively on  
> SSD but home can gain much more because unsed parts of the rootfs are  
> available for caching. 
>  
> The split-setup preference in turn gives you a fallback boot option in case  
> bcache chokes: You still have a working rootfs to do repairs or restore  
> backups. In my setup I encounter that problem with a working USB3-HD mirror  
> of my system I can boot and restore from which is synced and snapshotted  
> every night (so it also protects against accidental file deletion synced  
> undetected into the backup). Most valuable data is stored remotely (photos,  
> source code, documents, configuration, etc). 
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: caching device setup
  2015-04-08 18:56   ` Kai Krakow
  2015-04-09  3:05     ` Lidong Zhong
@ 2015-04-09  3:08     ` Lidong Zhong
  1 sibling, 0 replies; 8+ messages in thread
From: Lidong Zhong @ 2015-04-09  3:08 UTC (permalink / raw)
  To: Kai Krakow, linux-bcache

>>> On 4/9/2015 at 11:05 AM, in message <5525EC60.8F7 : 225 : 10347>, Lidong Zhong
wrote: 

> Hi David, 
Hi Kai, I am really sorry for the wrong name :\

> I am curious about how rootfs and home share the SSD dynamically. Are they  
> on 
> the same partition? Sorry for stupid questions since I just touched bcache  
> recently. 
>  
> Regards, 
> Lidong 
>> cache then depending on demands. So rootfs is a bit slower as natively on   
>> SSD but home can gain much more because unsed parts of the rootfs are   
>> available for caching.  
>>   
>> The split-setup preference in turn gives you a fallback boot option in case   
>> bcache chokes: You still have a working rootfs to do repairs or restore   
>> backups. In my setup I encounter that problem with a working USB3-HD mirror   
>> of my system I can boot and restore from which is synced and snapshotted   
>> every night (so it also protects against accidental file deletion synced   
>> undetected into the backup). Most valuable data is stored remotely (photos,   
>> source code, documents, configuration, etc).  
>   
>  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: caching device setup
  2015-04-09  3:05     ` Lidong Zhong
@ 2015-04-10 22:26       ` Kai Krakow
  2015-04-13  7:58         ` Lidong Zhong
  0 siblings, 1 reply; 8+ messages in thread
From: Kai Krakow @ 2015-04-10 22:26 UTC (permalink / raw)
  To: linux-bcache

Lidong Zhong <lzhong@suse.com> schrieb:

>>>> On 4/9/2015 at 02:56 AM, in message
>>>> <98agvb-l7r.ln1@hurikhan77.spdns.de>, Kai
> Krakow <hurikhan77@gmail.com> wrote:
>> David Mohr <david@mcbf.net> schrieb:
>>  
>> > On 2015-04-06 09:44, arnaud gaboury wrote:
>> >> Here is my overall plan:
>> >>  
>> >> root filesystem & OS on a SSD
>> >> DB and other stuff on HD.
>> >> Use ssd as caching device and HD as backing.
>> >>  
>> >> Shall I partition the SSD with : one partition for OS and one empty
>> >> for bcache? Or install the OS on the whole SSD and use the whole SSD
>> >> as caching device?
>> >>  
>> >> Thank you for hint.
>> >  
>> > So this is just depending on your preference, how big the SSD is, and
>> > how much space you expect your OS to take up.
>> >  
>> > Personally I split my SSD into two partitions: one for the root FS, and
>> > the other as a caching device for /home.
>>  
>> The other preference is valid, too: I chose to put bcache only on the SSD
>> to
>>  
>> get maximum benefit from its capacity, rootfs and home dynamically share
>> the
>>  
> I am curious about how rootfs and home share the SSD dynamically. Are they
> on the same partition? Sorry for stupid questions since I just touched
> bcache recently.

Cache and backing device association is not 1:1. You can attach multiple 
backing partitions (even from distinct filesystems) to the one and same 
caching partition. So, accesses to one of the cached filesystems will go 
through the same bcache, thus sharing the cache space through bcache's LRU 
implementation (or if you change it from the default, even something else 
like LRU).

Here's my setup (shortened):

├─sdb3        8:19   0  79,5G  0 part
│ ├─bcache0 252:0    0 925,5G  0 disk
│ ├─bcache1 252:1    0 925,5G  0 disk
│ └─bcache2 252:2    0 925,5G  0 disk

with sdb3 being the one and only bcache partition on SSD:

$ ls -al /sys/fs/bcache/
insgesamt 0
drwxr-xr-x  3 root root    0 11. Apr 00:25 .
drwxr-xr-x 11 root root    0  6. Apr 19:07 ..
drwxr-xr-x  7 root root    0  8. Apr 20:33 bf2b67f9-a261-4d27-
a6ef-2961f2ce2cc2
--w-------  1 root root 4096  8. Apr 20:33 register
--w-------  1 root root 4096  6. Apr 19:08 register_quiet

$ ls -al /sys/fs/bcache/bf2b67f9-a261-4d27-a6ef-2961f2ce2cc2/
insgesamt 0
drwxr-xr-x 7 root root    0 11. Apr 00:25 .
drwxr-xr-x 3 root root    0 11. Apr 00:25 ..
-r--r--r-- 1 root root 4096  8. Apr 20:33 average_key_size
lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev0 -> 
../../../devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sdc/sdc2/bcache
lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev1 -> 
../../../devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sdd/sdd2/bcache
lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev2 -> 
../../../devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sde/sde2/bcache
-r--r--r-- 1 root root 4096  8. Apr 20:33 block_size
-r--r--r-- 1 root root 4096  8. Apr 20:33 btree_cache_size
-r--r--r-- 1 root root 4096  8. Apr 20:33 bucket_size
lrwxrwxrwx 1 root root    0  8. Apr 20:33 cache0 -> 
../../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sdb/sdb3/bcache
[...]


-- 
Replies to list only preferred.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: caching device setup
  2015-04-10 22:26       ` Kai Krakow
@ 2015-04-13  7:58         ` Lidong Zhong
  0 siblings, 0 replies; 8+ messages in thread
From: Lidong Zhong @ 2015-04-13  7:58 UTC (permalink / raw)
  To: linux-bcache

>> On 4/11/2015 at 06:26 AM, in message <u8vlvb-ciu.ln1@hurikhan77.spdns.de>, Kai
Krakow <hurikhan77@gmail.com> wrote: 
> Lidong Zhong <lzhong@suse.com> schrieb: 
>  
>>>>> On 4/9/2015 at 02:56 AM, in message 
>>>>> <98agvb-l7r.ln1@hurikhan77.spdns.de>, Kai 
> > Krakow <hurikhan77@gmail.com> wrote: 
> >> David Mohr <david@mcbf.net> schrieb: 
> >>   
> > I am curious about how rootfs and home share the SSD dynamically. Are they 
> > on the same partition? Sorry for stupid questions since I just touched 
> > bcache recently. 
>  
> Cache and backing device association is not 1:1. You can attach multiple  
> backing partitions (even from distinct filesystems) to the one and same  
> caching partition. So, accesses to one of the cached filesystems will go  
> through the same bcache, thus sharing the cache space through bcache's LRU  
> implementation (or if you change it from the default, even something else  
> like LRU). 
>  
> Here's my setup (shortened): 
>  
> ├─sdb3        8:19   0  79,5G  0 part 
> │ ├─bcache0 252:0    0 925,5G  0 disk 
> │ ├─bcache1 252:1    0 925,5G  0 disk 
> │ └─bcache2 252:2    0 925,5G  0 disk 
>  
> with sdb3 being the one and only bcache partition on SSD: 
>  
> $ ls -al /sys/fs/bcache/ 
> insgesamt 0 
> drwxr-xr-x  3 root root    0 11. Apr 00:25 . 
> drwxr-xr-x 11 root root    0  6. Apr 19:07 .. 
> drwxr-xr-x  7 root root    0  8. Apr 20:33 bf2b67f9-a261-4d27- 
> a6ef-2961f2ce2cc2 
> --w-------  1 root root 4096  8. Apr 20:33 register 
> --w-------  1 root root 4096  6. Apr 19:08 register_quiet 
>  
> $ ls -al /sys/fs/bcache/bf2b67f9-a261-4d27-a6ef-2961f2ce2cc2/ 
> insgesamt 0 
> drwxr-xr-x 7 root root    0 11. Apr 00:25 . 
> drwxr-xr-x 3 root root    0 11. Apr 00:25 .. 
> -r--r--r-- 1 root root 4096  8. Apr 20:33 average_key_size 
> lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev0 ->  
> ../../../devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/bloc 
> k/sdc/sdc2/bcache 
> lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev1 ->  
> ../../../devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/bloc 
> k/sdd/sdd2/bcache 
> lrwxrwxrwx 1 root root    0  8. Apr 20:33 bdev2 ->  
> ../../../devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/bloc 
> k/sde/sde2/bcache 
> -r--r--r-- 1 root root 4096  8. Apr 20:33 block_size 
> -r--r--r-- 1 root root 4096  8. Apr 20:33 btree_cache_size 
> -r--r--r-- 1 root root 4096  8. Apr 20:33 bucket_size 
> lrwxrwxrwx 1 root root    0  8. Apr 20:33 cache0 ->  
> ../../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/bloc 
> k/sdb/sdb3/bcache 
> [...] 
>  
Thank you for your detailed explanation.

Regards,
Lidong
>  
> --  
> Replies to list only preferred. 
>  
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in 
> the body of a message to majordomo@vger.kernel.org 
> More majordomo info at  http://vger.kernel.org/majordomo-info.html 
>  
>  

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-04-13  7:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-06 15:44 caching device setup arnaud gaboury
2015-04-06 15:57 ` David Mohr
2015-04-08 18:56   ` Kai Krakow
2015-04-09  3:05     ` Lidong Zhong
2015-04-10 22:26       ` Kai Krakow
2015-04-13  7:58         ` Lidong Zhong
2015-04-09  3:08     ` Lidong Zhong
     [not found] ` <CAPBO7TY13PYVh3d0bt3tkc_+_vJVybCy-kBBT223VfPmQkjuWw@mail.gmail.com>
2015-04-06 17:44   ` arnaud gaboury

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.