[sheepdog] auto recovery after mount failure

Liu Yuan namei.unix at gmail.com
Fri Jul 20 07:57:43 CEST 2012


On 07/20/2012 12:28 PM, Dietmar Maurer wrote:
> 
>>> Any idea how to prevent that. Maybe we should not create/initialize
>>> the storage automatically at startup, man used a 'mksheepdogfs' to
>> initialize the dir.
>>> That way the 'sheep' can check if the directory is initialized/mounted?
>>
>> I handled this differently in my rc.startup: rather than mounting the
>> partitions with mount -a from /etc/fstab, I labelled them with sheep-FOO,
>> and did something like
>>
>>   SHEEP=$(blkid -s LABEL | sed -n 's/: LABEL="\(sheep-[^"]*\)".*/ \1/p')
>>   PORT=7000; while read DEVICE LABEL; do
>>     mkdir -p "/mnt/$LABEL" \
>>       && mount -o user_xattr "$DEVICE" "/mnt/$LABEL" \
>>       && sheep -D -p $PORT "/mnt/$LABEL" \
>>       && let PORT++
>>   done <<< "$SHEEP"
>>
>> so I only got sheep daemons for partitions that I'd correctly mounted.
> 
> To complex for me ;-)
> 
> I still think a 'mkfs' tool would be better. Especially because most other systems 
> do it the same way (you need to initialize the storage before use).
> 

I don't think mkfs tool is necessary for Sheepdog. Sheepdog operate on
the very high level construct, known as 'directory', so we can play
storage tricks behind and if any problem could be solved outside
Sheepdog, we prefer to solve it outside unless it is proved reasonable
and necessary to solve it inside Sheepdog.

Thanks,
Yuan




More information about the sheepdog mailing list